Esempio n. 1
0
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
}
Esempio n. 2
0
File: meter.go Progetto: wptad/dvara
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)
}
Esempio n. 3
0
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)
}
Esempio n. 4
0
File: timer.go Progetto: wptad/dvara
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)
}
Esempio n. 5
0
File: gauge.go Progetto: wptad/dvara
func (g *Gauge) writeMeta(c *gmetric.Client) {
	c.WriteMeta(&g.gmetric)
}
Esempio n. 6
0
func (c *Counter) writeMeta(client *gmetric.Client) {
	client.WriteMeta(&c.gmetric)
}