web-monitor/

directory
v0.0.0-...-42829d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2021 License: Apache-2.0

Directories

Path Synopsis
Usage: import "github.com/baidu/go-lib/web-monitor/metrics" // define counter struct type type ServerState { ReqServed *Counter // field type must be *Counter or *Gauge or *State ConServed *Counter ConActive *Gauge } // create metrics var m Metrics var s ServerState m.Init(&s, "PROXY", 20) // counter operations s.ConActive.Inc(2) s.ConServed.Inc(1) s.ReqServed.Inc(1) s.ConActive.Dec(1) m.Counter("CounterName").Inc(1) m.Gauge("GaugeName").Inc(1) m.State("StateName").Set("StateValue") // get absoulute data for all metrics stateData := m.GetAll() // get diff data for all counters(gauge don't have diff data) stateDiff := m.GetDiff()
Usage: import "github.com/baidu/go-lib/web-monitor/metrics" // define counter struct type type ServerState { ReqServed *Counter // field type must be *Counter or *Gauge or *State ConServed *Counter ConActive *Gauge } // create metrics var m Metrics var s ServerState m.Init(&s, "PROXY", 20) // counter operations s.ConActive.Inc(2) s.ConServed.Inc(1) s.ReqServed.Inc(1) s.ConActive.Dec(1) m.Counter("CounterName").Inc(1) m.Gauge("GaugeName").Inc(1) m.State("StateName").Set("StateValue") // get absoulute data for all metrics stateData := m.GetAll() // get diff data for all counters(gauge don't have diff data) stateDiff := m.GetDiff()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL