DomGarguilo commented on code in PR #4924:
URL: https://github.com/apache/accumulo/pull/4924#discussion_r1775543315


##########
server/manager/src/main/java/org/apache/accumulo/manager/metrics/fate/FateMetrics.java:
##########
@@ -60,16 +61,10 @@ public class FateMetrics implements MetricsProducer {
   private final String fateRootPath;
   private final long refreshDelay;
 
-  private AtomicLong totalCurrentOpsGauge;
-  private AtomicLong totalOpsGauge;
-  private AtomicLong fateErrorsGauge;
-  private AtomicLong newTxGauge;
-  private AtomicLong submittedTxGauge;
-  private AtomicLong inProgressTxGauge;
-  private AtomicLong failedInProgressTxGauge;
-  private AtomicLong failedTxGauge;
-  private AtomicLong successfulTxGauge;
-  private AtomicLong unknownTxGauge;
+  private final AtomicLong totalCurrentOpsCount = new AtomicLong(0);
+  private final AtomicLong totalOpsCount = new AtomicLong(0);
+  private final AtomicLong fateErrorsCount = new AtomicLong(0);
+  private final EnumMap<TStatus,AtomicLong> txStatusCounters = new 
EnumMap<>(TStatus.class);

Review Comment:
   > My point is that a counter only goes up, a gauge can go up or down.
   
   When describing micrometer instruments, yes, a `Gauge` can go up or down 
where as `Counter`s should be only increasing. 
   
   The AtomicLong variables (e.g., submittedTxCount) are used to store the 
current counts and are referenced by Micrometer Gauges. They aren't Gauge 
objects themselves, so naming them "count" accurately reflects their role as "a 
variable tracking the count of something" and imo we shouldn't apply the 
"rules" associated with how the micrometer instruments are named when naming 
other variables even if they are used in reference to micrometer instruments. 
The only "gauge" that I am aware of is a micrometer gauge so naming a `Gauge` 
object variable with "gauge" seems fine (not the case here) but otherwise it 
seems confusing to me.



-- 
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]

Reply via email to