ProfileFunc profiles a function using the global profiler
(ctx context.Context, operation string, fn func() error)
| 191 | |
| 192 | // ProfileFunc profiles a function using the global profiler |
| 193 | func ProfileFunc(ctx context.Context, operation string, fn func() error) (*Profile, error) { |
| 194 | if globalProfiler == nil { |
| 195 | return nil, fn() |
| 196 | } |
| 197 | return globalProfiler.ProfileFunc(ctx, operation, fn) |
| 198 | } |
| 199 | |
| 200 | // ProfileFuncWithMetrics profiles a function with metrics using the global profiler |
| 201 | func ProfileFuncWithMetrics(ctx context.Context, operation string, fn func() (int, int64, error)) (*Profile, error) { |
nothing calls this directly
no test coverage detected