File: count.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 (18 lines) | stat: -rw-r--r-- 287 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package dogstatsd

import "github.com/raintank/met"

type Count struct {
	key     string
	backend Backend
}

func (b Backend) NewCount(key string) met.Count {
	c := Count{key, b}
	c.Inc(0)
	return c
}

func (c Count) Inc(val int64) {
	c.backend.client.Count(c.key, val, []string{}, 1)
}