зеркало из https://github.com/microsoft/statsd.git
Merge pull request #418 from genuss/hist_dots
Don't allow histogram bins contain dots
This commit is contained in:
Коммит
7c29c5bc6e
|
@ -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']));
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче