dschneider-pivotal commented on a change in pull request #7363:
URL: https://github.com/apache/geode/pull/7363#discussion_r807213669
##########
File path:
geode-for-redis/src/main/java/org/apache/geode/redis/internal/statistics/GeodeRedisStats.java
##########
@@ -30,170 +32,197 @@
import org.apache.geode.redis.internal.commands.RedisCommandType;
public class GeodeRedisStats {
+
+ public static final String STATS_BASENAME = "GeodeForRedisStats";
+ private static final String GENERAL_CATEGORY = "General";
+
@Immutable
- private static final StatisticsType type;
+ private static final Map<String, StatisticsType> statisticTypes = new
HashMap<>();
@Immutable
private static final EnumMap<RedisCommandType, Integer>
completedCommandStatIds =
new EnumMap<>(RedisCommandType.class);
@Immutable
private static final EnumMap<RedisCommandType, Integer> timeCommandStatIds =
new EnumMap<>(RedisCommandType.class);
- private static final int currentlyConnectedClients;
+ private static final int currentlyConnectedClientsId;
private static final int passiveExpirationChecksId;
private static final int passiveExpirationCheckTimeId;
private static final int passiveExpirationsId;
private static final int expirationsId;
private static final int expirationTimeId;
- private static final int totalConnectionsReceived;
- private static final int commandsProcessed;
- private static final int keyspaceHits;
- private static final int keyspaceMisses;
- private static final int totalNetworkBytesRead;
+ private static final int totalConnectionsReceivedId;
+ private static final int commandsProcessedId;
+ private static final int keyspaceHitsId;
+ private static final int keyspaceMissesId;
+ private static final int totalNetworkBytesReadId;
private static final int publishRequestsCompletedId;
private static final int publishRequestsInProgressId;
private static final int publishRequestTimeId;
private static final int subscribersId;
private static final int uniqueChannelSubscriptionsId;
private static final int uniquePatternSubscriptionsId;
- private final Statistics stats;
+ private final Statistics generalStats;
+ private final Map<String, Statistics> statistics = new HashMap<>();
private final StatisticsClock clock;
- public GeodeRedisStats(StatisticsFactory factory, String name,
StatisticsClock clock) {
+ public GeodeRedisStats(StatisticsFactory factory, StatisticsClock clock) {
this.clock = clock;
- stats = factory == null ? null : factory.createAtomicStatistics(type,
name);
+ generalStats = factory == null ? null
+ : factory.createAtomicStatistics(statisticTypes.get(GENERAL_CATEGORY),
STATS_BASENAME);
Review comment:
If you look all the down in StatisticsImpl line 131 you will find it
handling a null textId by using the type's name: `this.textId =
StringUtils.isEmpty(textId) ? statisticsManager.getName() : textId;`
##########
File path:
geode-for-redis/src/main/java/org/apache/geode/redis/internal/statistics/GeodeRedisStats.java
##########
@@ -30,170 +32,197 @@
import org.apache.geode.redis.internal.commands.RedisCommandType;
public class GeodeRedisStats {
+
+ public static final String STATS_BASENAME = "GeodeForRedisStats";
+ private static final String GENERAL_CATEGORY = "General";
+
@Immutable
- private static final StatisticsType type;
+ private static final Map<String, StatisticsType> statisticTypes = new
HashMap<>();
Review comment:
It seems like you should either add General as a Category (does that
cause other problems?) or keep the general one out of these maps. If you do the
latter then you would just have a map for the category ones and you would have
another instance variable that just directly references the general one. So in
this example you would have "EnumMap<Category, StatisticsType> categoryTypes;"
and "StatisticsType generalType".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]