зеркало из https://github.com/microsoft/statsd.git
switch process_metrics to take a callback function
This commit is contained in:
Родитель
c3d87eaa82
Коммит
c341f969e3
|
@ -1,4 +1,4 @@
|
|||
var process_metrics = function (metrics, flushInterval) {
|
||||
var process_metrics = function (metrics, flushInterval, ts, flushCallback) {
|
||||
var starttime = Date.now();
|
||||
var key;
|
||||
var counter_rates = {};
|
||||
|
@ -81,8 +81,7 @@ var process_metrics = function (metrics, flushInterval) {
|
|||
//add processed metrics to the metrics_hash
|
||||
metrics.counter_rates = counter_rates;
|
||||
metrics.timer_data = timer_data;
|
||||
|
||||
return metrics;
|
||||
flushCallback(ts, metrics);
|
||||
}
|
||||
|
||||
exports.process_metrics = process_metrics
|
||||
|
|
7
stats.js
7
stats.js
|
@ -71,10 +71,11 @@ function flushMetrics() {
|
|||
}
|
||||
});
|
||||
|
||||
metrics_hash = pm.process_metrics(metrics_hash, flushInterval)
|
||||
pm.process_metrics(metrics_hash, flushInterval, time_stamp, function emitFlush() {
|
||||
// Flush metrics to each backend.
|
||||
backendEvents.emit('flush', time_stamp, metrics_hash);
|
||||
});
|
||||
|
||||
// Flush metrics to each backend.
|
||||
backendEvents.emit('flush', time_stamp, metrics_hash);
|
||||
};
|
||||
|
||||
var stats = {
|
||||
|
|
Загрузка…
Ссылка в новой задаче