Esempio n. 1
0
func (p *parser) handleCounters(t *tuple) error {
	if !strings.HasPrefix(t.Name(), counterPrefix) {
		return nil
	}
	id := new(bucket.Id)
	p.buildId(id, t)
	id.Type = "counter"
	val, err := t.Float64()
	if err != nil {
		return err
	}
	p.out <- &bucket.Bucket{Id: id, Vals: []float64{val}}
	return nil
}
Esempio n. 2
0
func (p *parser) handleLegacyMeasurements(t *tuple) error {
	if !strings.HasPrefix(t.Name(), legacyPrefix) {
		return nil
	}
	id := new(bucket.Id)
	p.buildId(id, t)
	id.Type = "measurement"
	val, err := t.Float64()
	if err != nil {
		return err
	}
	p.out <- &bucket.Bucket{Id: id, Vals: []float64{val}}
	return nil
}
Esempio n. 3
0
func (p *parser) handleHkRouter(t *tuple) error {
	if string(p.lr.Header().Procid) != routerPrefix {
		return nil
	}
	id := new(bucket.Id)
	p.buildId(id, t)
	id.Type = "measurement"
	switch t.Name() {
	case "bytes":
		id.Name = p.Prefix("router.bytes")
	case "connect":
		id.Name = p.Prefix("router.connect")
	case "service":
		id.Name = p.Prefix("router.service")
	default:
		return nil
	}
	val, err := t.Float64()
	if err != nil {
		return err
	}
	p.out <- &bucket.Bucket{Id: id, Vals: []float64{val}}
	return nil
}