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

org.apache.rocketmq.shaded.io.opentelemetry.sdk.metrics.internal.state.MultiBoundStorageHandle 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.sdk.metrics.internal.state;

import org.apache.rocketmq.shaded.io.opentelemetry.api.common.Attributes;
import org.apache.rocketmq.shaded.io.opentelemetry.context.Context;
import java.util.List;

/** Storage handle that aggregates across several instances. */
class MultiBoundStorageHandle implements BoundStorageHandle {
  private final List underlyingHandles;

  MultiBoundStorageHandle(List handles) {
    this.underlyingHandles = handles;
  }

  @Override
  public void recordLong(long value, Attributes attributes, Context context) {
    for (BoundStorageHandle handle : underlyingHandles) {
      handle.recordLong(value, attributes, context);
    }
  }

  @Override
  public void recordDouble(double value, Attributes attributes, Context context) {
    for (BoundStorageHandle handle : underlyingHandles) {
      handle.recordDouble(value, attributes, context);
    }
  }

  @Override
  public void release() {
    for (BoundStorageHandle handle : underlyingHandles) {
      handle.release();
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy