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:
Vivien Barousse 2012-08-09 14:16:47 +01:00
Родитель 159b4c2641
Коммит a5f161cea5
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -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);