Merge pull request #418 from genuss/hist_dots

Don't allow histogram bins contain dots
This commit is contained in:
Daniel Schauenberg 2014-05-15 15:54:45 -04:00
Родитель 67d51c48ae 0ed6e39696
Коммит 7c29c5bc6e
2 изменённых файлов: 2 добавлений и 2 удалений

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

@ -122,7 +122,7 @@ var process_metrics = function (metrics, flushInterval, ts, flushCallback) {
for (; i < count && (bins[bin_i] == 'inf' || values[i] < bins[bin_i]); i++) {
freq += 1;
}
bin_name = 'bin_' + bins[bin_i];
bin_name = 'bin_' + bins[bin_i].toString().replace('.', '_');
current_timer_data['histogram'][bin_name] = freq;
}

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

@ -192,7 +192,7 @@ module.exports = {
// only 'abc' should have a bin_inf; also check all its counts,
// and make sure it has no other bins
test.equal(1, timer_data['abc']['histogram']['bin_1']);
test.equal(0, timer_data['abc']['histogram']['bin_2.21']);
test.equal(0, timer_data['abc']['histogram']['bin_2_21']);
test.equal(4, timer_data['abc']['histogram']['bin_inf']);
test.equal(3, _.size(timer_data['abc']['histogram']));