use of co.cask.cdap.api.metrics.MetricType in project cdap by caskdata.
the class AggregatedMetricsEmitter method emit.
@Override
public MetricValue emit() {
// todo CDAP-2195 - potential race condition , reseting value and type has to be done together
long value = this.value.getAndSet(0);
MetricType type = gaugeUsed.getAndSet(false) ? MetricType.GAUGE : MetricType.COUNTER;
return new MetricValue(name, type, value);
}
Aggregations