use of org.apache.hadoop.metrics2.MetricStringBuilder in project hadoop by apache.
the class S3AInstrumentation method dump.
/**
* Dump all the metrics to a string.
* @param prefix prefix before every entry
* @param separator separator between name and value
* @param suffix suffix
* @param all get all the metrics even if the values are not changed.
* @return a string dump of the metrics
*/
public String dump(String prefix, String separator, String suffix, boolean all) {
MetricStringBuilder metricBuilder = new MetricStringBuilder(null, prefix, separator, suffix);
registry.snapshot(metricBuilder, all);
for (Map.Entry<String, MutableCounterLong> entry : streamMetrics.entrySet()) {
metricBuilder.tuple(entry.getKey(), Long.toString(entry.getValue().value()));
}
return metricBuilder.toString();
}
Aggregations