diff --git a/internal/proxy/app_conn.go b/internal/proxy/app_conn.go index 0720d282b..5aae531a6 100644 --- a/internal/proxy/app_conn.go +++ b/internal/proxy/app_conn.go @@ -240,6 +240,9 @@ func (app *appConnSnapshot) ApplySnapshotChunkSync( return app.appConn.ApplySnapshotChunkSync(ctx, req) } +// addTimeSample returns a function that, when called, adds a sample to m for +// the time elapsed since the original call to addTimeSample. This function should +// be deferred near the start of a function to be sampled. func addTimeSample(m metrics.Histogram) func() { start := time.Now() return func() { m.Observe(time.Since(start).Seconds()) }