Skip to content

Commit a7dfbea

Browse files
authored
Bugfix: LatencyRecorder::expose CHECK fails when save_series flag is false (#3022)
1 parent e0fe40e commit a7dfbea

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/bvar/latency_recorder.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,12 @@ int LatencyRecorder::expose(const butil::StringPiece& prefix1,
253253
if (_latency_percentiles.expose_as(prefix, "latency_percentiles", DISPLAY_ON_HTML) != 0) {
254254
return -1;
255255
}
256-
snprintf(namebuf, sizeof(namebuf), "%d%%,%d%%,%d%%,99.9%%",
257-
(int)FLAGS_bvar_latency_p1, (int)FLAGS_bvar_latency_p2,
258-
(int)FLAGS_bvar_latency_p3);
259-
CHECK_EQ(0, _latency_percentiles.set_vector_names(namebuf));
256+
if (FLAGS_save_series) {
257+
snprintf(namebuf, sizeof(namebuf), "%d%%,%d%%,%d%%,99.9%%",
258+
(int)FLAGS_bvar_latency_p1, (int)FLAGS_bvar_latency_p2,
259+
(int)FLAGS_bvar_latency_p3);
260+
CHECK_EQ(0, _latency_percentiles.set_vector_names(namebuf));
261+
}
260262
return 0;
261263
}
262264

0 commit comments

Comments
 (0)