Documentation
¶
Index ¶
Constants ¶
const ( DefaultTemplate = `` /* 902-byte string literal not displayed */ DefaultMaxPoints = 40 DefaultTimeFormat = "15:04:05" DefaultInterval = 1500 DefaultAddr = "localhost:18066" DefaultTheme = ThemeMacarons )
const (
VCStack = "stack"
)
const (
VGCCPUFraction = "gccpufraction"
)
const (
VGCNum = "gcnum"
)
const (
VGCSzie = "gcsize"
)
const (
VGoroutine = "goroutine"
)
const (
VHeap = "heap"
)
Variables ¶
This section is empty.
Functions ¶
func SetConfiguration ¶
func SetConfiguration(opts ...Option)
func StartRTCollect ¶
func StartRTCollect()
Types ¶
type GCCPUFractionViewer ¶
type GCCPUFractionViewer struct {
// contains filtered or unexported fields
}
GCCPUFractionViewer collects the GC-CPU fraction metric from `runtime.ReadMemStats()`
func (*GCCPUFractionViewer) Name ¶
func (vr *GCCPUFractionViewer) Name() string
func (*GCCPUFractionViewer) Serve ¶
func (vr *GCCPUFractionViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*GCCPUFractionViewer) View ¶
func (vr *GCCPUFractionViewer) View() *charts.Line
type GCNumViewer ¶
type GCNumViewer struct {
// contains filtered or unexported fields
}
GCNumViewer collects the GC number metric from `runtime.ReadMemStats()`
func (*GCNumViewer) Name ¶
func (vr *GCNumViewer) Name() string
func (*GCNumViewer) Serve ¶
func (vr *GCNumViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*GCNumViewer) View ¶
func (vr *GCNumViewer) View() *charts.Line
type GCSizeViewer ¶
type GCSizeViewer struct {
// contains filtered or unexported fields
}
GCSizeViewer collects the GC size metric from `runtime.ReadMemStats()`
func (*GCSizeViewer) Name ¶
func (vr *GCSizeViewer) Name() string
func (*GCSizeViewer) Serve ¶
func (vr *GCSizeViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*GCSizeViewer) View ¶
func (vr *GCSizeViewer) View() *charts.Line
type GoroutinesViewer ¶
type GoroutinesViewer struct {
// contains filtered or unexported fields
}
GoroutinesViewer collects the goroutine number metric from `runtime.NumGoroutine()`
func (*GoroutinesViewer) Name ¶
func (vr *GoroutinesViewer) Name() string
func (*GoroutinesViewer) Serve ¶
func (vr *GoroutinesViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*GoroutinesViewer) View ¶
func (vr *GoroutinesViewer) View() *charts.Line
type HeapViewer ¶
type HeapViewer struct {
// contains filtered or unexported fields
}
HeapViewer collects the heap-stats metrics from `runtime.ReadMemStats()` including `HeapAlloc` / `HeapInuse` / `HeapSys` / `HeapIdle`
func (*HeapViewer) Name ¶
func (vr *HeapViewer) Name() string
func (*HeapViewer) Serve ¶
func (vr *HeapViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*HeapViewer) View ¶
func (vr *HeapViewer) View() *charts.Line
type Option ¶
type Option func(c *config)
func WithInterval ¶
WithInterval sets the interval of collecting and pulling metrics
func WithMaxPoints ¶
WithMaxPoints sets the maximum points of each chart series
func WithTemplate ¶
WithTemplate sets the rendered template which fetching stats from the server and handling the metrics data
func WithTimeFormat ¶
WithTimeFormat sets the time format for the line-chart Y-axis label
type StackViewer ¶
type StackViewer struct {
// contains filtered or unexported fields
}
StackViewer collects the stack-stats metrics from `runtime.ReadMemStats()` including `StackSys` / `StackInuse` / `MSpanSys` / `MSpanInuse`
func (*StackViewer) Name ¶
func (vr *StackViewer) Name() string
func (*StackViewer) Serve ¶
func (vr *StackViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*StackViewer) View ¶
func (vr *StackViewer) View() *charts.Line
type Theme ¶
type Theme string
const ( ThemeWesteros Theme = types.ThemeWesteros ThemeMacarons Theme = types.ThemeMacarons )
type Viewer ¶
type Viewer interface {
Name() string
View() *charts.Line
Serve(w http.ResponseWriter, _ *http.Request)
}
func NewGCCPUFractionViewer ¶
func NewGCCPUFractionViewer() Viewer
func NewGCNumViewer ¶
func NewGCNumViewer() Viewer
func NewGCSizeViewer ¶
func NewGCSizeViewer() Viewer
func NewGoroutinesViewer ¶
func NewGoroutinesViewer() Viewer
func NewHeapViewer ¶
func NewHeapViewer() Viewer
func NewStackViewer ¶
func NewStackViewer() Viewer