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

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

There is a newer version: 1.13.0
Show newest version
package com.github.marschall.micrometer.jfr;

import java.util.List;

import io.micrometer.core.instrument.Meter.Id;
import jdk.jfr.AnnotationElement;
import jdk.jfr.Description;
import jdk.jfr.EventFactory;
import jdk.jfr.Label;
import jdk.jfr.ValueDescriptor;

final class DistributionSummaryEventFactory extends AbstractMeterEventFactory {

  DistributionSummaryEventFactory(Id id) {
    super(id);
  }

  @Override
  protected List getAdditionalValueDescriptors() {
    List amountAnnotations = List.of(
        new AnnotationElement(Label.class, "Amount"),
        new AnnotationElement(Description.class, "Amount for an event being measured."));
    ValueDescriptor amountDescriptor = new ValueDescriptor(double.class, "amount", amountAnnotations);

    return List.of(amountDescriptor);
  }

  @Override
  JfrDistributionSummaryEvent newEmptyEvent(EventFactory eventFactory) {
    return new JfrDistributionSummaryEvent(this.id, eventFactory.newEvent());
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy