Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶ added in v0.4.1
func Init(opts Options)
Init will run a god compatible debug endpoint.
Example ¶
// init
Init(Options{})
// block events
go func() {
for {
<-time.After(time.Millisecond)
}
}()
// mutex events
var m sync.Mutex
for i := 0; i < 2; i++ {
go func() {
for {
m.Lock()
time.Sleep(time.Millisecond)
m.Unlock()
}
}()
}
fmt.Println("Hello")
select {}
Output: Hello
func TrackFloat ¶ added in v0.3.0
TrackFloat will track a float over time.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a simple operations counter.
func NewCounter ¶
NewCounter will create and return a counter.
type Metric ¶ added in v0.4.1
type Metric interface {
// Collect is called every second to retrieve the current value.
Collect() string
}
Metric represents a periodically collected metric.
type Options ¶ added in v0.4.1
type Options struct {
// The port to run the debug interface on.
//
// Default: 6060.
Port int
// The memory profile rate.
//
// Default: 1024.
MemoryProfileRate int
// The mutex profile fraction.
//
// Default: 1.
MutexProfileFraction int
// The block profile rate.
//
// Default: 1.
BlockProfileRate int
// Custom handler for the status endpoint.
//
// Default: "OK" writer.
StatusHandler http.HandlerFunc
// Custom handler for the metrics endpoint.
MetricsHandler http.HandlerFunc
}
Options define the available debugging options.
Click to show internal directories.
Click to hide internal directories.