Skip to content

Commit 07f49aa

Browse files
author
Xin Dong
committed
Rename and use correct time unit
1 parent 63cf5ae commit 07f49aa

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Constants.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ const char* MT_TIME_INSERT_LATENCY_US = "dl_insert_latency_useconds";
7676
const char* MT_HIST_INSERT_SZ = "dl_insert_size_bytes";
7777
const char* MT_HIST_TR_PER_REQUEST = "dl_tr_per_request";
7878
const char* MT_RATE_IDX_REBUILD = "dl_index_rebuild_rate";
79-
const uint64_t SLOW_QUERY_THRESHOLD_SECONDS = 10;
79+
const uint64_t SLOW_QUERY_THRESHOLD_MICRO_SECONDS = 10000;
8080

8181
} // namespace DocLayerConstants

src/Constants.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ extern const char* MT_HIST_INSERT_SZ;
9090
extern const char* MT_HIST_TR_PER_REQUEST;
9191
extern const char* MT_RATE_IDX_REBUILD;
9292
// TODO: make this part of the knob/options instead of constants?
93-
extern const uint64_t SLOW_QUERY_THRESHOLD_SECONDS;
93+
extern const uint64_t SLOW_QUERY_THRESHOLD_MICRO_SECONDS;
9494

9595
} // namespace DocLayerConstants
9696

src/ExtMsg.actor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,13 @@ ACTOR static Future<Void> doRun(Reference<ExtMsgQuery> query, Reference<ExtConne
514514
}
515515
}
516516

517-
uint64_t queryLatencySeconds = (timer_int() - startTime) / 1000;
518-
DocumentLayer::metricReporter->captureTime(DocLayerConstants::MT_TIME_QUERY_LATENCY_US, queryLatencySeconds);
517+
uint64_t queryLatencyMicroSeconds = (timer_int() - startTime) / 1000;
518+
DocumentLayer::metricReporter->captureTime(DocLayerConstants::MT_TIME_QUERY_LATENCY_US, queryLatencyMicroSeconds);
519519

520-
if (slowQueryLogging && queryLatencySeconds >= DocLayerConstants::SLOW_QUERY_THRESHOLD_SECONDS) {
521-
TraceEvent("SlowQuery")
522-
.detail("Threshold", DocLayerConstants::SLOW_QUERY_THRESHOLD_SECONDS)
523-
.detail("Duration", queryLatencySeconds)
520+
if (slowQueryLogging && queryLatencyMicroSeconds >= DocLayerConstants::SLOW_QUERY_THRESHOLD_MICRO_SECONDS) {
521+
TraceEvent(SevWarn, "SlowQuery")
522+
.detail("ThresholdMicroSeconds", DocLayerConstants::SLOW_QUERY_THRESHOLD_MICRO_SECONDS)
523+
.detail("DurationMicroSeconds", queryLatencyMicroSeconds)
524524
.detail("Query", query->toString());
525525
}
526526

0 commit comments

Comments
 (0)