本文整理匯總了Golang中github.com/facebookgo/ganglia/gmetric.Client.WriteMeta方法的典型用法代碼示例。如果您正苦於以下問題:Golang Client.WriteMeta方法的具體用法?Golang Client.WriteMeta怎麽用?Golang Client.WriteMeta使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/facebookgo/ganglia/gmetric.Client
的用法示例。
在下文中一共展示了Client.WriteMeta方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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)
}
示例3: 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)
}
示例4: 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)
}
示例5: writeMeta
func (g *Gauge) writeMeta(c *gmetric.Client) {
c.WriteMeta(&g.gmetric)
}
示例6: writeMeta
func (c *Counter) writeMeta(client *gmetric.Client) {
client.WriteMeta(&c.gmetric)
}