You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/02/14 21:46:25 UTC

[GitHub] [geode] jdeppe-pivotal commented on a change in pull request #7363: GEODE-10034: Organize Geode For Redis Stats By Category

jdeppe-pivotal commented on a change in pull request #7363:
URL: https://github.com/apache/geode/pull/7363#discussion_r806264838



##########
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:
       Seems like if I do that the `textId` just ends up being empty.




-- 
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: notifications-unsubscribe@geode.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org