func (c *counter) Inc(i int64) {
	atomic.AddInt64(&c.count, i)
}
Inc increments the counter by the given amount.
package metrics
import "sync/atomic"
type Counter interface {
	Reset()
	Count() int64
	Dec(int64)
	Inc(int64)
	Snapshot() Counter
}
func GetOrRegisterCounter(name string, r Metrics) Counter {
	return r.GetOrRegister(name, NewCounter).(Counter)
}
func NewCounter() Counter {
	return &counter{0}
}
type CounterSnapshot int64
func (CounterSnapshot) Reset() {
	panic("Clear called on a CounterSnapshot")
}
func (c CounterSnapshot) Count() int64 { return int64(c) }
func (CounterSnapshot) Dec(int64) {
	panic("Dec called on a CounterSnapshot")
}
func (CounterSnapshot) Inc(int64) {
	panic("Inc called on a CounterSnapshot")
}
func (c CounterSnapshot) Snapshot() Counter { return c }
type counter struct {
	count int64
}
func (c *counter) Reset() {
	atomic.StoreInt64(&c.count, 0)
}
func (c *counter) Count() int64 {
	return atomic.LoadInt64(&c.count)
}
func (c *counter) Dec(i int64) {
	atomic.AddInt64(&c.count, -i)
}