Documentation
¶
Index ¶
- Constants
- func WithPprofLabel(key string, val string, req *http.Request, fn func())
- type Agent
- func (a *Agent) Configure(agentKey string, appName string)
- func (a *Agent) MeasureHandler(pattern string, handler http.Handler) (string, http.Handler)
- func (a *Agent) MeasureHandlerFunc(pattern string, handlerFunc func(http.ResponseWriter, *http.Request)) (string, func(http.ResponseWriter, *http.Request))
- func (a *Agent) MeasureSegment(segmentName string) *Segment
- func (a *Agent) Profile() *Span
- func (a *Agent) ProfileHandler(pattern string, handler http.Handler) (string, http.Handler)
- func (a *Agent) ProfileHandlerFunc(pattern string, handlerFunc func(http.ResponseWriter, *http.Request)) (string, func(http.ResponseWriter, *http.Request))
- func (a *Agent) ProfileWithName(name string) *Span
- func (a *Agent) RecordAndRecoverPanic()
- func (a *Agent) RecordError(err interface{})
- func (a *Agent) RecordPanic()
- func (a *Agent) Report()
- func (a *Agent) ReportAllocationProfile()
- func (a *Agent) ReportWithHTTPClient(client *http.Client)
- func (a *Agent) Start(options Options)
- func (a *Agent) StartBlockProfiler()
- func (a *Agent) StartCPUProfiler()
- func (a *Agent) StopBlockProfiler()
- func (a *Agent) StopCPUProfiler()
- func (a *Agent) UpdateOptions(options Options)
- type Options
- type Segment
- type Span
Constants ¶
const ErrorGroupHandledExceptions string = "Handled exceptions"
const ErrorGroupRecoveredPanics string = "Recovered panics"
const ErrorGroupUnrecoveredPanics string = "Unrecovered panics"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct { // compatibility < 1.2.0 DashboardAddress string AgentKey string AppName string HostName string Debug bool // contains filtered or unexported fields }
func Start ¶ added in v1.4.3
Starts the agent with configuration options. Required options are AgentKey and AppName.
func (*Agent) MeasureHandler ¶ added in v1.3.10
DEPRECATED. A helper function to measure HTTP handler execution by wrapping http.Handle method parameters.
func (*Agent) MeasureHandlerFunc ¶ added in v1.3.10
func (a *Agent) MeasureHandlerFunc(pattern string, handlerFunc func(http.ResponseWriter, *http.Request)) (string, func(http.ResponseWriter, *http.Request))
DEPRECATED. A helper function to measure HTTP handler function execution by wrapping http.HandleFunc method parameters.
func (*Agent) MeasureSegment ¶ added in v1.1.2
DEPRECATED. Starts measurement of execution time of a code segment. To stop measurement call Stop on returned Segment object. After calling Stop the segment is recorded, aggregated and reported with regular intervals.
func (*Agent) Profile ¶
Use this method to instruct the agent to start and stop profiling. It does not guarantee that any profiler will be started. The decision is made by the agent based on the overhead constraints. The method returns Span object, on which the Stop() method should be called.
func (*Agent) ProfileHandler ¶
A helper function to profile HTTP handler execution by wrapping http.Handle method parameters.
func (*Agent) ProfileHandlerFunc ¶
func (a *Agent) ProfileHandlerFunc(pattern string, handlerFunc func(http.ResponseWriter, *http.Request)) (string, func(http.ResponseWriter, *http.Request))
A helper function to profile HTTP handler function execution by wrapping http.HandleFunc method parameters.
func (*Agent) ProfileWithName ¶
This method is similar to the Profile() method. It additionally allows to specify a span name to group span timing measurements.
func (*Agent) RecordAndRecoverPanic ¶ added in v1.2.0
func (a *Agent) RecordAndRecoverPanic()
Aggregates and reports panics with regular intervals. This function also recovers from panics
func (*Agent) RecordError ¶ added in v1.2.0
func (a *Agent) RecordError(err interface{})
Aggregates and reports errors with regular intervals.
func (*Agent) RecordPanic ¶ added in v1.2.0
func (a *Agent) RecordPanic()
Aggregates and reports panics with regular intervals.
func (*Agent) ReportAllocationProfile ¶
func (a *Agent) ReportAllocationProfile()
Report current allocation profile to the Dashboard.
func (*Agent) ReportWithHTTPClient ¶
DEPRECATED. Kept for compatibility.
func (*Agent) Start ¶ added in v1.2.0
Starts the agent with configuration options. Required options are AgentKey and AppName.
func (*Agent) StartBlockProfiler ¶
func (a *Agent) StartBlockProfiler()
Start blocking call profiler. Automatic profiling should be disabled.
func (*Agent) StartCPUProfiler ¶
func (a *Agent) StartCPUProfiler()
Start CPU profiler. Automatic profiling should be disabled.
func (*Agent) StopBlockProfiler ¶
func (a *Agent) StopBlockProfiler()
Stop blocking call profiler and report the recorded profile to the Dashboard.
func (*Agent) StopCPUProfiler ¶
func (a *Agent) StopCPUProfiler()
Stop CPU profiler and report the recorded profile to the Dashboard.
func (*Agent) UpdateOptions ¶
Update some options after the agent has already been started. Only ProxyAddress, HTTPClient and Debug options are updatable.
Directories
¶
Path | Synopsis |
---|---|
examples
|
|
pprof/profile
Package profile provides a representation of profile.proto and methods to encode/decode profiles in this format.
|
Package profile provides a representation of profile.proto and methods to encode/decode profiles in this format. |