зеркало из https://github.com/microsoft/statsd.git
Add sets support in the graphite backend
The backend doesn't support sets of data, so the count of unique elements is sent instead
This commit is contained in:
Родитель
159b4c2641
Коммит
a5f161cea5
|
@ -59,6 +59,7 @@ var flush_stats = function graphite_flush(ts, metrics) {
|
|||
var counters = metrics.counters;
|
||||
var gauges = metrics.gauges;
|
||||
var timers = metrics.timers;
|
||||
var sets = metrics.sets;
|
||||
var pctThreshold = metrics.pctThreshold;
|
||||
|
||||
for (key in counters) {
|
||||
|
@ -135,6 +136,11 @@ var flush_stats = function graphite_flush(ts, metrics) {
|
|||
numStats += 1;
|
||||
}
|
||||
|
||||
for (key in sets) {
|
||||
statString += 'stats.sets.' + key + '.count ' + sets[key].values().length + ' ' + ts + "\n";
|
||||
numStats += 1;
|
||||
}
|
||||
|
||||
statString += 'statsd.numStats ' + numStats + ' ' + ts + "\n";
|
||||
statString += 'stats.statsd.graphiteStats.calculationtime ' + (Date.now() - starttime) + ' ' + ts + "\n";
|
||||
post_stats(statString);
|
||||
|
|
Загрузка…
Ссылка в новой задаче