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

io.opentelemetry.sdk.metrics.internal.exemplar.LongToDoubleExemplarReservoir Maven / Gradle / Ivy

There is a newer version: 1.44.1
Show newest version
/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package io.opentelemetry.sdk.metrics.internal.exemplar;

import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.context.Context;
import io.opentelemetry.sdk.metrics.data.ExemplarData;
import java.util.List;

class LongToDoubleExemplarReservoir implements ExemplarReservoir {

  private final ExemplarReservoir delegate;

  LongToDoubleExemplarReservoir(ExemplarReservoir delegate) {
    this.delegate = delegate;
  }

  @Override
  public void offerDoubleMeasurement(double value, Attributes attributes, Context context) {
    delegate.offerDoubleMeasurement(value, attributes, context);
  }

  @Override
  public void offerLongMeasurement(long value, Attributes attributes, Context context) {
    offerDoubleMeasurement((double) value, attributes, context);
  }

  @Override
  public List collectAndReset(Attributes pointAttributes) {
    return delegate.collectAndReset(pointAttributes);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy