зеркало из https://github.com/microsoft/statsd.git
Don't allow histogram bins contain dots
This commit is contained in:
Родитель
61c9607eee
Коммит
0ed6e39696
|
@ -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']));
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче