Skip to content

Commit f34bfc7

Browse files
committed
workload: don't record changefeed resolve latency before first checkpoint
Before the first checkpoint the changefeed-resolved metrics would just be whatever the max bucket of the histogram was. Now, we don't start recording the metric until we have the first checkpoint. The histogram will report 0 for time periods where we don't record a value. Epic: none Release note: None
1 parent 75b649c commit f34bfc7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/workload/changefeeds/changefeeds.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,11 @@ func AddChangefeedToQueryLoad(
182182
} else {
183183
return errors.Errorf("failed to parse CHANGEFEED event: %s", values[2])
184184
}
185-
// Resolved timestamps arrived infrequently. Always record the time since
186-
// our lastResolved so that we don't get long periods of 0 in the
187-
// histogram.
188-
if cfResolved != nil {
185+
186+
// Resolved timestamps arrived infrequently. We always record the time
187+
// since our lastResolved if we have one. Until we have a resolved
188+
// timestamp, the histogram will report 0.
189+
if cfResolved != nil && !lastResolved.IsEmpty() {
189190
cfResolved.Record(timeutil.Since(lastResolved.GoTime()))
190191
}
191192
return nil

0 commit comments

Comments
 (0)