Update internal/proxy/app_conn.go

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
This commit is contained in:
William Banfield
2021-10-13 12:21:35 -04:00
committed by GitHub
parent e049236c68
commit c5a72c44cc

View File

@@ -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()) }