Skip to content

Commit 7487733

Browse files
craig[bot]stevendanna
andcommitted
Merge #156296
156296: workload: set changfeed-resolved latency to 0 before the first checkpoint r=wenyihu6 a=stevendanna Before the first checkpoint the changefeed-resolved metrics would just be whatever the max bucket of the histogram was. Now, we record 0 to signal we haven't seen a checkpoint yet. Epic: none Release note: None Co-authored-by: Steven Danna <[email protected]>
2 parents 0313a71 + f34bfc7 commit 7487733

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)