Skip to content

Commit

Permalink
Load: change the metric type of LoadDiskIO metric from RATE to COUNTER (
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniSho authored Jun 21, 2024
1 parent b1e9d96 commit 0b8e314
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.apache.iotdb.metrics.AbstractMetricService;
import org.apache.iotdb.metrics.impl.DoNothingMetricManager;
import org.apache.iotdb.metrics.metricsets.IMetricSet;
import org.apache.iotdb.metrics.type.Rate;
import org.apache.iotdb.metrics.type.Counter;
import org.apache.iotdb.metrics.type.Timer;
import org.apache.iotdb.metrics.utils.MetricLevel;
import org.apache.iotdb.metrics.utils.MetricType;
Expand All @@ -50,7 +50,7 @@ private LoadTsFileCostMetricsSet() {
private Timer secondPhaseTimer = DoNothingMetricManager.DO_NOTHING_TIMER;
private Timer loadLocallyTimer = DoNothingMetricManager.DO_NOTHING_TIMER;

private Rate diskIORate = DoNothingMetricManager.DO_NOTHING_RATE;
private Counter diskIOCounter = DoNothingMetricManager.DO_NOTHING_COUNTER;

public void recordPhaseTimeCost(String stage, long costTimeInNanos) {
switch (stage) {
Expand All @@ -72,7 +72,7 @@ public void recordPhaseTimeCost(String stage, long costTimeInNanos) {
}

public void recordDiskIO(long bytes) {
diskIORate.mark(bytes);
diskIOCounter.inc(bytes);
}

@Override
Expand All @@ -99,8 +99,8 @@ public void bindTo(AbstractMetricService metricService) {
Tag.NAME.toString(),
LOAD_LOCALLY);

diskIORate =
metricService.getOrCreateRate(
diskIOCounter =
metricService.getOrCreateCounter(
Metric.LOAD_DISK_IO.toString(),
MetricLevel.IMPORTANT,
Tag.NAME.toString(),
Expand Down

0 comments on commit 0b8e314

Please sign in to comment.