Documentation
¶
Overview ¶
Package profile captures phase timing, CPU profiles, and HTTP round-trip logs for performance analysis.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GraphQLLabel ¶
GraphQLLabel extracts the operation label from ctx, or "" if absent.
func WithGraphQLLabel ¶
WithGraphQLLabel returns a context that tags subsequent HTTP requests with a GraphQL operation label (e.g. "resolve", "reachability", "peel"). The loggingTransport uses this to break down POST /graphql by purpose.
Types ¶
type HTTPLog ¶
type HTTPLog struct {
// contains filtered or unexported fields
}
HTTPLog collects per-request timing data.
func (*HTTPLog) WriteSummary ¶
WriteSummary prints aggregated HTTP stats.
type Options ¶
type Options struct {
TracePath string // runtime/trace output file (viewable with `go tool trace`)
CPUProfilePath string // pprof CPU profile output file
HTTPLog bool // log every HTTP round-trip
Output io.Writer
}
Options configures what profiling to enable.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session holds all profiling state for one CLI invocation. Create with Start, tear down with Stop (writes summaries).
func (*Session) Phase ¶
Phase records wall-clock timing for a named phase. Call the returned function when the phase ends.
func (*Session) WrapTransport ¶
func (s *Session) WrapTransport(rt http.RoundTripper) http.RoundTripper
WrapTransport wraps an http.RoundTripper with request logging. Returns the original transport if HTTP logging is disabled.