Skip to content

Commit

Permalink
add metric
Browse files Browse the repository at this point in the history
  • Loading branch information
xy720 committed Jan 16, 2025
1 parent 96ac860 commit 3419dc5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.doris.common.Status;
import org.apache.doris.common.ThreadPoolManager;
import org.apache.doris.common.util.MasterDaemon;
import org.apache.doris.metric.MetricRepo;
import org.apache.doris.system.Backend;
import org.apache.doris.thrift.BackendService;
import org.apache.doris.thrift.TNetworkAddress;
Expand Down Expand Up @@ -244,7 +245,7 @@ protected void runAfterCatalogReady() {
public void waitForTabletStatUpdate() {
boolean ok = true;
try {
if (!updateTabletStatsLatch.await(60, TimeUnit.SECONDS)) {
if (!updateTabletStatsLatch.await(600, TimeUnit.SECONDS)) {
LOG.info("timeout waiting {} update tablet stats tasks finish after {} seconds.",
updateTabletStatsLatch.getCount(), 60);
ok = false;
Expand All @@ -261,6 +262,9 @@ public void waitForTabletStatUpdate() {
}
LOG.warn("Failed to update tablet stats reason: {}, unfinished backends: {}",
status.getErrorMsg(), unfinishedBackendIds);
if (MetricRepo.isInit) {
MetricRepo.COUNTER_UPDATE_TABLET_STAT_FAILED.increase(1L);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ public final class MetricRepo {
public static LongCounterMetric COUNTER_CACHE_HIT_SQL;
public static LongCounterMetric COUNTER_CACHE_HIT_PARTITION;

public static LongCounterMetric COUNTER_UPDATE_TABLET_STAT_FAILED;

public static LongCounterMetric COUNTER_EDIT_LOG_WRITE;
public static LongCounterMetric COUNTER_EDIT_LOG_READ;
public static LongCounterMetric COUNTER_EDIT_LOG_CURRENT;
Expand Down Expand Up @@ -495,6 +497,10 @@ public Long getValue() {
"counter of failed transactions");
COUNTER_TXN_FAILED.addLabel(new MetricLabel("type", "failed"));
DORIS_METRIC_REGISTER.addMetrics(COUNTER_TXN_FAILED);
COUNTER_UPDATE_TABLET_STAT_FAILED = new LongCounterMetric("update_tablet_stat_failed", MetricUnit.REQUESTS,
"counter of failed to update tablet stat");
COUNTER_UPDATE_TABLET_STAT_FAILED.addLabel(new MetricLabel("type", "failed"));
DORIS_METRIC_REGISTER.addMetrics(COUNTER_UPDATE_TABLET_STAT_FAILED);
HISTO_TXN_EXEC_LATENCY = METRIC_REGISTER.histogram(
MetricRegistry.name("txn", "exec", "latency", "ms"));
HISTO_TXN_PUBLISH_LATENCY = METRIC_REGISTER.histogram(
Expand Down

0 comments on commit 3419dc5

Please sign in to comment.