本文整理匯總了Golang中github.com/facebookgo/ganglia/gmetric.Client類的典型用法代碼示例。如果您正苦於以下問題:Golang Client類的具體用法?Golang Client怎麽用?Golang Client使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Client類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: AddStats
func (self *gmetricc) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error {
if stats == nil {
return nil
}
fmt.Println("----------------addstats--------------------")
//ab := gmetric.ClientFromFlag("hello")
ab := gmetric.Client{
Addr: []net.Addr{
&net.UDPAddr{IP: net.ParseIP("103.56.92.26"), Port: 8651},
},
}
m := &gmetric.Metric{
Name: "uint8_metric",
Host: "103.56.92.26",
ValueType: gmetric.ValueUint8,
Units: "count",
Slope: gmetric.SlopeBoth,
TickInterval: 20 * time.Second,
Lifetime: 24 * time.Hour,
}
const val = 10
if err1 := ab.WriteMeta(m); err1 != nil {
fmt.Println(err1)
}
if err2 := ab.WriteValue(m, val); err2 != nil {
fmt.Println(err2)
}
return nil
}
示例2: writeValue
func (m *Meter) writeValue(c *gmetric.Client) {
c.WriteValue(&m.count, m.Count())
c.WriteValue(&m.m1rate, m.Rate1())
c.WriteValue(&m.m5rate, m.Rate5())
c.WriteValue(&m.m15rate, m.Rate15())
c.WriteValue(&m.meanRate, m.RateMean())
}
示例3: writeMeta
func (m *Meter) writeMeta(c *gmetric.Client) {
c.WriteMeta(&m.count)
c.WriteMeta(&m.m1rate)
c.WriteMeta(&m.m5rate)
c.WriteMeta(&m.m15rate)
c.WriteMeta(&m.meanRate)
}
示例4: writeMeta
func (h *Histogram) writeMeta(c *gmetric.Client) {
c.WriteMeta(&h.max)
c.WriteMeta(&h.mean)
c.WriteMeta(&h.min)
c.WriteMeta(&h.stddev)
c.WriteMeta(&h.p50)
c.WriteMeta(&h.p75)
c.WriteMeta(&h.p95)
c.WriteMeta(&h.p98)
c.WriteMeta(&h.p99)
c.WriteMeta(&h.p999)
}
示例5: writeValue
func (h *Histogram) writeValue(c *gmetric.Client) {
ps := h.Percentiles(histogramTrackedPercentiles)
c.WriteValue(&h.max, h.Max())
c.WriteValue(&h.mean, h.Mean())
c.WriteValue(&h.min, h.Min())
c.WriteValue(&h.stddev, h.StdDev())
c.WriteValue(&h.p50, ps[0])
c.WriteValue(&h.p75, ps[1])
c.WriteValue(&h.p95, ps[2])
c.WriteValue(&h.p98, ps[3])
c.WriteValue(&h.p99, ps[4])
c.WriteValue(&h.p999, ps[5])
}
示例6: writeMeta
func (t *Timer) writeMeta(c *gmetric.Client) {
c.WriteMeta(&t.max)
c.WriteMeta(&t.mean)
c.WriteMeta(&t.min)
c.WriteMeta(&t.stddev)
c.WriteMeta(&t.p50)
c.WriteMeta(&t.p75)
c.WriteMeta(&t.p95)
c.WriteMeta(&t.p98)
c.WriteMeta(&t.p99)
c.WriteMeta(&t.p999)
}
示例7: writeValue
func (t *Timer) writeValue(c *gmetric.Client) {
ps := t.Percentiles(timerTrackedPercentiles)
c.WriteValue(&t.max, t.normalizeInt64(t.Max()))
c.WriteValue(&t.mean, t.normalizeFloat64(t.Mean()))
c.WriteValue(&t.min, t.normalizeInt64(t.Min()))
c.WriteValue(&t.stddev, t.normalizeFloat64(t.StdDev()))
c.WriteValue(&t.p50, t.normalizeFloat64(ps[0]))
c.WriteValue(&t.p75, t.normalizeFloat64(ps[1]))
c.WriteValue(&t.p95, t.normalizeFloat64(ps[2]))
c.WriteValue(&t.p98, t.normalizeFloat64(ps[3]))
c.WriteValue(&t.p99, t.normalizeFloat64(ps[4]))
c.WriteValue(&t.p999, t.normalizeFloat64(ps[5]))
}
示例8: writeValue
func (g *Gauge) writeValue(c *gmetric.Client) {
c.WriteValue(&g.gmetric, g.Value())
}
示例9: writeMeta
func (g *Gauge) writeMeta(c *gmetric.Client) {
c.WriteMeta(&g.gmetric)
}
示例10: writeValue
func (c *Counter) writeValue(client *gmetric.Client) {
client.WriteValue(&c.gmetric, c.Count())
}
示例11: writeMeta
func (c *Counter) writeMeta(client *gmetric.Client) {
client.WriteMeta(&c.gmetric)
}