All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.marschall.micrometer.jfr.JfrMeterEvent Maven / Gradle / Ivy

There is a newer version: 1.13.0
Show newest version
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);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy