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

org.apache.rocketmq.shaded.io.opentelemetry.api.metrics.LongCounterBuilder Maven / Gradle / Ivy

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

package org.apache.rocketmq.shaded.io.opentelemetry.api.metrics;

import java.util.function.Consumer;

/** Builder class for {@link LongCounter}. */
public interface LongCounterBuilder {

  /**
   * Sets the description for this instrument.
   *
   * 

Description strings should follow the instrument description rules: * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-description */ LongCounterBuilder setDescription(String description); /** * Sets the unit of measure for this instrument. * *

Unit strings should follow the instrument unit rules: * https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#instrument-unit */ LongCounterBuilder setUnit(String unit); /** Sets the counter for recording {@code double} values. */ DoubleCounterBuilder ofDoubles(); /** * Builds and returns a {@code LongCounter} with the desired options. * * @return a {@code LongCounter} with the desired options. */ LongCounter build(); /** * Builds this asynchronous instrument with the given callback. * *

The callback will only be called when the {@link Meter} is being observed. * *

Callbacks are expected to abide by the following restrictions: * *

    *
  • Run in a finite amount of time. *
  • Safe to call repeatedly, across multiple threads. *
  • Return positive, monotonically increasing values. *
* * @param callback A state-capturing callback used to observe values on-demand. */ ObservableLongCounter buildWithCallback(Consumer callback); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy