use of org.platformlayer.metrics.MetricsSource in project platformlayer by platformlayer.
the class PlatformlayerMetricsReporter method run.
@Override
public void run() {
long now = clock.time() / 1000;
if (previousRun == null) {
// TODO: Zero metrics??
previousRun = now;
return;
}
MetricTreeObject tree = new MetricTreeObject(null);
addTimestampRange(tree, previousRun, now);
// final long epoch = clock.time() / 1000;
if (this.printVMMetrics) {
printVmMetrics(tree);
}
addCodahaleMetrics(tree);
for (MetricsSource reporter : registry.getAdditionalSources()) {
reporter.addMetrics(tree);
}
if (metricSender.sendMetrics(tree)) {
// TODO: Zero metrics??
previousRun = now;
}
}
Aggregations