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() |
Click to show internal directories.
Click to hide internal directories.