Function
measureRequest
(ctx context.Context, method string, col instr.Collector, toStatusCode func(error) string, f func(context.Context) error)
Source from the content-addressed store, hash-verified
| 50 | } |
| 51 | |
| 52 | func measureRequest(ctx context.Context, method string, col instr.Collector, toStatusCode func(error) string, f func(context.Context) error) error { |
| 53 | start := time.Now() |
| 54 | col.Before(ctx, method, start) |
| 55 | err := f(ctx) |
| 56 | col.After(ctx, method, toStatusCode(err), start) |
| 57 | return err |
| 58 | } |
Tested by
no test coverage detected