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

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

/*
 * 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;

/** Selects which {@link FixedSizeExemplarReservoir} {@link ReservoirCell} receives measurements. */
interface ReservoirCellSelector {

  /** Determine the index of the {@code cells} to record the measurement to. */
  int reservoirCellIndexFor(
      ReservoirCell[] cells, long value, Attributes attributes, Context context);

  /** Determine the index of the {@code cells} to record the measurement to. */
  int reservoirCellIndexFor(
      ReservoirCell[] cells, double value, Attributes attributes, Context context);

  /** Called when {@link FixedSizeExemplarReservoir#collectAndReset(Attributes)}. */
  void reset();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy