You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/10/02 18:20:01 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #2297: Rework GC rest code in Monitor

ctubbsii commented on a change in pull request #2297:
URL: https://github.com/apache/accumulo/pull/2297#discussion_r720710692



##########
File path: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/gc/GarbageCollectorResource.java
##########
@@ -24,13 +24,12 @@
 import jakarta.ws.rs.Produces;
 import jakarta.ws.rs.core.MediaType;
 
-import org.apache.accumulo.core.gc.thrift.GCStatus;
 import org.apache.accumulo.monitor.Monitor;
 
 /**
  * GarbageCollector metrics
  *
- * @since 2.0.0
+ * @since 2.1.0

Review comment:
       You're changing it in 2.1, but it the `/gc` endpoint was still introduced in 2.0. These aren't exactly public API, so it shouldn't matter, but it is a little strange to change this to an incorrect value.

##########
File path: server/monitor/src/main/java/org/apache/accumulo/monitor/rest/gc/GarbageCollectorStats.java
##########
@@ -19,42 +19,40 @@
 package org.apache.accumulo.monitor.rest.gc;
 
 import org.apache.accumulo.core.gc.thrift.GcCycleStats;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
- * Metrics about a single cycle of the garbage collector
+ * Metrics about one type of garbage collection
  *
- * @since 2.0.0
+ * @since 2.1.0
  */
-public class GarbageCollectorCycle {
-
-  private static final GarbageCollectorCycle EMPTY = new GarbageCollectorCycle();
+public class GarbageCollectorStats {
+  private static final Logger log = LoggerFactory.getLogger(GarbageCollectorStats.class);
 
   // Variable names become JSON key
-  public long started = 0L;
+  public String type;
   public long finished = 0L;
   public long candidates = 0L;
   public long inUse = 0L;
   public long deleted = 0L;
   public long errors = 0L;
-
-  public GarbageCollectorCycle() {}
+  public long duration = 0L;

Review comment:
       Seems like these should be final




-- 
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@accumulo.apache.org

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