Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load: change the metric type of LoadDiskIO metric from RATE to COUNTER #12787

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading