Skip to content

Commit 6754bd2

Browse files
committed
Adjust estimated query count metric to only count dispatch if it was necessary
This is a more accurate estimate
1 parent 9a2d398 commit 6754bd2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

internal/graph/check.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,9 @@ func (cc *ConcurrentChecker) checkDirect(ctx context.Context, crc currentRequest
214214
hadDirectResult := false
215215
hadDispatchedResult := false
216216
defer (func() {
217-
estimatedQueryCount := 0.0
218-
if hadDirectResult {
219-
estimatedQueryCount++
220-
}
221-
if hadDispatchedResult {
222-
estimatedQueryCount++
217+
estimatedQueryCount := 1.0
218+
if !hadDirectResult && hadDispatchedResult {
219+
estimatedQueryCount = 2
223220
}
224221
estimatedDirectDispatchQueryHistogram.Observe(estimatedQueryCount)
225222
})()

0 commit comments

Comments
 (0)