Pengzna commented on code in PR #11410:
URL: https://github.com/apache/iotdb/pull/11410#discussion_r1375451600


##########
iotdb-core/metrics/core/src/main/java/org/apache/iotdb/metrics/core/type/IoTDBRate.java:
##########
@@ -33,49 +34,50 @@
  * <p>Now, we only record a gauge for the rate record in micrometer, and we 
use dropwizard meter to
  * calculate the meter.
  */
-public class MicrometerRate implements Rate {
-  AtomicLong atomicLong;
+public class IoTDBRate extends AbstractJmxRateBean implements Rate, 
IoTDBRateMBean {
   Meter meter;
 
-  public MicrometerRate(AtomicLong atomicLong) {
-    this.atomicLong = atomicLong;
-    this.meter = new Meter();
+  public IoTDBRate() {
+    this.meter = new Meter(new IoTDBMovingAverage(), Clock.defaultClock());
   }
 
   @Override
   public long getCount() {
-    return meter.getCount();
+    return this.count();
+  }
+
+  @Override
+  public double getMeanRate() {
+    return this.meanRate();
   }
 
   @Override
   public double getOneMinuteRate() {
-    return meter.getOneMinuteRate();
+    return this.oneMinuteRate();
   }
 
   @Override
-  public double getMeanRate() {
-    return meter.getMeanRate();
+  public long count() {
+    return meter.getCount();
   }
 
   @Override
-  public double getFiveMinuteRate() {
-    return meter.getFiveMinuteRate();
+  public double oneMinuteRate() {
+    return meter.getOneMinuteRate();
   }

Review Comment:
   `oneMinuteRate` is method that really works, and `getOneMinuteRate` is the 
getter method that allows JMX to get the properties.



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