updating emitter with new statsd names
JP Robinson
7 years ago
63 | 63 | // comes first. Fields are ignored. |
64 | 64 | func (e *Emitter) NewCounter(key string) metrics.Counter { |
65 | 65 | key = e.prefix + key |
66 | return &statsdCounter{ | |
66 | return &counter{ | |
67 | 67 | key: key, |
68 | 68 | c: stringToKeyVal(key, e.keyVals), |
69 | 69 | } |
78 | 78 | // milliseconds. If you observe in units of nanoseconds, you can make the |
79 | 79 | // translation with a ScaledHistogram: |
80 | 80 | // |
81 | // NewScaledHistogram(statsdHistogram, time.Millisecond) | |
81 | // NewScaledHistogram(histogram, time.Millisecond) | |
82 | 82 | // |
83 | 83 | // You can also enforce the constraint in a typesafe way with a millisecond |
84 | 84 | // TimeHistogram: |
85 | 85 | // |
86 | // NewTimeHistogram(statsdHistogram, time.Millisecond) | |
86 | // NewTimeHistogram(histogram, time.Millisecond) | |
87 | 87 | // |
88 | 88 | // TODO: support for sampling. |
89 | 89 | func (e *Emitter) NewHistogram(key string) metrics.Histogram { |
90 | 90 | key = e.prefix + key |
91 | return &statsdHistogram{ | |
91 | return &histogram{ | |
92 | 92 | key: key, |
93 | 93 | h: stringToKeyVal(key, e.keyVals), |
94 | 94 | } |
102 | 102 | // TODO: support for sampling |
103 | 103 | func (e *Emitter) NewGauge(key string) metrics.Gauge { |
104 | 104 | key = e.prefix + key |
105 | return &statsdGauge{ | |
105 | return &gauge{ | |
106 | 106 | key: key, |
107 | 107 | g: stringToKeyVal(key, e.keyVals), |
108 | 108 | } |