com.github.marschall.micrometer.jfr.JfrMeterEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micrometer-jfr Show documentation
Show all versions of micrometer-jfr Show documentation
A Micrometer meter registry that generates JFR events
package com.github.marschall.micrometer.jfr;
import io.micrometer.core.instrument.Measurement;
import io.micrometer.core.instrument.Meter.Id;
import io.micrometer.core.instrument.Meter.Type;
import jdk.jfr.Event;
final class JfrMeterEvent extends AbstractJfrMeterEvent {
JfrMeterEvent(Id id, Event event) {
super(id, event);
}
void recordValues(Type type, Iterable measurements) {
int attributeIndex = 0;
attributeIndex = this.setCommonEventAttributes(attributeIndex);
// use the type from the id
// this.event.set(attributeIndex++, type.name());
for (Measurement measurement : measurements) {
double value = measurement.getValue();
this.event.set(attributeIndex++, value);
}
}
}