Documentation ¶
Index ¶
- Constants
- func Addr() string
- func Interval() int
- func LinkAddr() string
- func SetConfiguration(opts ...Option)
- type GCCPUFractionViewer
- type GCNumViewer
- type GCSizeViewer
- type GoroutinesViewer
- type HeapObjectsViewer
- type HeapViewer
- type Metrics
- type OffHeapViewer
- type Option
- type StackViewer
- type StatsMgr
- type Theme
- type Viewer
Constants ¶
const ( // VHeap is the name of HeapViewer VHeap = "heap memory" VHeapOBJ = "heap objects" )
const ( // VCStack is the name of StackViewer VCStack = "stack memory" VOFFHEAP = "off heap memory" )
const ( DefaultTemplate = `` /* 923-byte string literal not displayed */ DefaultMaxPoints = 30000 DefaultTimeFormat = "15:04:05" DefaultInterval = 2000 DefaultAddr = "localhost:60023" DefaultTheme = ThemeWesteros )
const (
// VGCCPUFraction is the name of GCCPUFractionViewer
VGCCPUFraction = "gccpufraction"
)
const (
// VGCNum is the name of GCNumViewer
VGCNum = "gcnum"
)
const (
// VGCSzie is the name of GCSizeViewer
VGCSize = "gcsize"
)
const (
// VGoroutine is the name of GoroutinesViewer
VGoroutine = "goroutine"
)
Variables ¶
This section is empty.
Functions ¶
func SetConfiguration ¶
func SetConfiguration(opts ...Option)
Types ¶
type GCCPUFractionViewer ¶
type GCCPUFractionViewer struct {
// contains filtered or unexported fields
}
GCCPUFractionViewer collects the GC-CPU fraction metric via `runtime.ReadMemStats()`
func (*GCCPUFractionViewer) Name ¶
func (vr *GCCPUFractionViewer) Name() string
func (*GCCPUFractionViewer) Serve ¶
func (vr *GCCPUFractionViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*GCCPUFractionViewer) SetStatsMgr ¶
func (vr *GCCPUFractionViewer) SetStatsMgr(smgr *StatsMgr)
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 via `runtime.ReadMemStats()`
func (*GCNumViewer) Name ¶
func (vr *GCNumViewer) Name() string
func (*GCNumViewer) Serve ¶
func (vr *GCNumViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*GCNumViewer) SetStatsMgr ¶
func (vr *GCNumViewer) SetStatsMgr(smgr *StatsMgr)
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 via `runtime.ReadMemStats()`
func (*GCSizeViewer) Name ¶
func (vr *GCSizeViewer) Name() string
func (*GCSizeViewer) Serve ¶
func (vr *GCSizeViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*GCSizeViewer) SetStatsMgr ¶
func (vr *GCSizeViewer) SetStatsMgr(smgr *StatsMgr)
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 via `runtime.NumGoroutine()`
func (*GoroutinesViewer) Name ¶
func (vr *GoroutinesViewer) Name() string
func (*GoroutinesViewer) Serve ¶
func (vr *GoroutinesViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*GoroutinesViewer) SetStatsMgr ¶
func (vr *GoroutinesViewer) SetStatsMgr(smgr *StatsMgr)
func (*GoroutinesViewer) View ¶
func (vr *GoroutinesViewer) View() *charts.Line
type HeapObjectsViewer ¶
type HeapObjectsViewer struct {
// contains filtered or unexported fields
}
func (*HeapObjectsViewer) Name ¶
func (vr *HeapObjectsViewer) Name() string
func (*HeapObjectsViewer) Serve ¶
func (vr *HeapObjectsViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*HeapObjectsViewer) SetStatsMgr ¶
func (vr *HeapObjectsViewer) SetStatsMgr(smgr *StatsMgr)
func (*HeapObjectsViewer) View ¶
func (vr *HeapObjectsViewer) View() *charts.Line
type HeapViewer ¶
type HeapViewer struct {
// contains filtered or unexported fields
}
HeapViewer collects the heap-stats metrics via `runtime.ReadMemStats()`
func (*HeapViewer) Name ¶
func (vr *HeapViewer) Name() string
func (*HeapViewer) Serve ¶
func (vr *HeapViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*HeapViewer) SetStatsMgr ¶
func (vr *HeapViewer) SetStatsMgr(smgr *StatsMgr)
func (*HeapViewer) View ¶
func (vr *HeapViewer) View() *charts.Line
type OffHeapViewer ¶
type OffHeapViewer struct {
// contains filtered or unexported fields
}
func (*OffHeapViewer) Name ¶
func (vr *OffHeapViewer) Name() string
func (*OffHeapViewer) Serve ¶
func (vr *OffHeapViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*OffHeapViewer) SetStatsMgr ¶
func (vr *OffHeapViewer) SetStatsMgr(smgr *StatsMgr)
func (*OffHeapViewer) View ¶
func (vr *OffHeapViewer) 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 via `runtime.ReadMemStats()`
func (*StackViewer) Name ¶
func (vr *StackViewer) Name() string
func (*StackViewer) Serve ¶
func (vr *StackViewer) Serve(w http.ResponseWriter, _ *http.Request)
func (*StackViewer) SetStatsMgr ¶
func (vr *StackViewer) SetStatsMgr(smgr *StatsMgr)
func (*StackViewer) View ¶
func (vr *StackViewer) View() *charts.Line
type StatsMgr ¶
type StatsMgr struct { Ctx context.Context Cancel context.CancelFunc // contains filtered or unexported fields }
func NewStatsMgr ¶
type Theme ¶
type Theme string
const ( ThemeWesteros Theme = types.ThemeWesteros ThemeMacarons Theme = types.ThemeMacarons ThemeChalk Theme = types.ThemeChalk ThemeEssos Theme = types.ThemeEssos ThemeInfographic Theme = types.ThemeInfographic ThemePurplePassion Theme = types.ThemePurplePassion ThemeRoma Theme = types.ThemeRoma ThemeRomantic Theme = types.ThemeRomantic ThemeShine Theme = types.ThemeShine ThemeVintage Theme = types.ThemeVintage ThemeWalden Theme = types.ThemeWalden ThemeWonderland Theme = types.ThemeWonderland )
type Viewer ¶
type Viewer interface { Name() string View() *charts.Line Serve(w http.ResponseWriter, _ *http.Request) SetStatsMgr(smgr *StatsMgr) }
Viewer is the abstraction of a Graph which in charge of collecting metrics from somewhere
func NewGCCPUFractionViewer ¶
func NewGCCPUFractionViewer() Viewer
NewGCCPUFractionViewer returns the GCCPUFractionViewer instance Series: Fraction
func NewGCNumViewer ¶
func NewGCNumViewer() Viewer
NewGCNumViewer returns the GCNumViewer instance Series: GcNum
func NewGCSizeViewer ¶
func NewGCSizeViewer() Viewer
NewGCSizeViewer returns the GCSizeViewer instance Series: GCSys / NextGC
func NewGoroutinesViewer ¶
func NewGoroutinesViewer() Viewer
NewGoroutinesViewer returns the GoroutinesViewer instance Series: Goroutines
func NewHeapObjectsViewer ¶
func NewHeapObjectsViewer() Viewer
func NewHeapViewer ¶
func NewHeapViewer() Viewer
NewHeapViewer returns the HeapViewer instance Series: Alloc / Inuse / Sys / Idle
func NewOffHeapViewer ¶
func NewOffHeapViewer() Viewer
func NewStackViewer ¶
func NewStackViewer() Viewer
NewStackViewer returns the StackViewer instance Series: StackSys / StackInuse / MSpanSys / MSpanInuse