File: meter.go

package info (click to toggle)
golang-github-raintank-met 0.0~git20190828.80f9c6e-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144 kB
  • sloc: makefile: 2
file content (20 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// it's commonly used for non-timer cases where we want these summaries, that's
// what this is for.
package dogstatsd

import "github.com/raintank/met"

type Meter struct {
	key     string
	backend Backend
}

func (b Backend) NewMeter(key string, val int64) met.Meter {
	m := Meter{key, b}
	m.Value(val)
	return m
}

func (m Meter) Value(val int64) {
	m.backend.client.Histogram(m.key, float64(val), []string{}, 1)
}