MCPcopy
hub / github.com/github/github-mcp-server / ProfileFuncWithMetrics

Function ProfileFuncWithMetrics

internal/profiler/profiler.go:201–207  ·  view source on GitHub ↗

ProfileFuncWithMetrics profiles a function with metrics using the global profiler

(ctx context.Context, operation string, fn func() (int, int64, error))

Source from the content-addressed store, hash-verified

199
200// ProfileFuncWithMetrics profiles a function with metrics using the global profiler
201func ProfileFuncWithMetrics(ctx context.Context, operation string, fn func() (int, int64, error)) (*Profile, error) {
202 if globalProfiler == nil {
203 _, _, err := fn()
204 return nil, err
205 }
206 return globalProfiler.ProfileFuncWithMetrics(ctx, operation, fn)
207}
208
209// Start begins timing using the global profiler
210func Start(ctx context.Context, operation string) func(int, int64) *Profile {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected