Skip to content

Commit

Permalink
collect metric results so that probe latecy can be reported in /debug…
Browse files Browse the repository at this point in the history
…/metrics

Signed-off-by: Shlomi Noach <[email protected]>
  • Loading branch information
shlomi-noach committed Jul 25, 2024
1 parent 0266758 commit 7efcd3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions go/vt/vttablet/tabletserver/throttle/throttler.go
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ func (throttler *Throttler) generateTabletProbeFunction(scope base.Scope, tmClie
// readSelfThrottleMetricsInternal rreads all registsred self metrics on this tablet (or backend MySQL server).
// This is the actual place where metrics are read, to be later aggregated and/or propagated to other tablets.
func (throttler *Throttler) readSelfThrottleMetricsInternal(ctx context.Context) base.ThrottleMetrics {

result := make(base.ThrottleMetrics)
writeMetric := func(metric *base.ThrottleMetric) {
select {
case <-ctx.Done():
Expand Down Expand Up @@ -960,8 +960,9 @@ func (throttler *Throttler) readSelfThrottleMetricsInternal(ctx context.Context)
metric.Alias = throttler.tabletAlias

go writeMetric(metric)
result[metricName] = metric
}
return nil
return result
}

func (throttler *Throttler) collectSelfMetrics(ctx context.Context) {
Expand Down

0 comments on commit 7efcd3f

Please sign in to comment.