use of io.micrometer.core.instrument.internal.DefaultMeter in project micrometer by micrometer-metrics.
the class AtlasMeterRegistry method newMeter.
@Override
protected Meter newMeter(Meter.Id id, Meter.Type type, Iterable<io.micrometer.core.instrument.Measurement> measurements) {
Id spectatorId = spectatorId(id);
com.netflix.spectator.api.AbstractMeter<Id> spectatorMeter = new com.netflix.spectator.api.AbstractMeter<Id>(registry.clock(), spectatorId, spectatorId) {
@Override
public Iterable<com.netflix.spectator.api.Measurement> measure() {
return stream(measurements.spliterator(), false).map(m -> {
com.netflix.spectator.api.Statistic stat = AtlasUtils.toSpectatorStatistic(m.getStatistic());
Id idWithStat = stat == null ? id : id.withTag("statistic", stat.toString());
return new com.netflix.spectator.api.Measurement(idWithStat, clock.wallTime(), m.getValue());
}).collect(toList());
}
};
registry.register(spectatorMeter);
return new DefaultMeter(id, type, measurements);
}
Aggregations