io.opentelemetry.exporter.internal.otlp.metrics.ValueAtQuantileStatelessMarshaler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opentelemetry-exporter-otlp-common Show documentation
Show all versions of opentelemetry-exporter-otlp-common Show documentation
OpenTelemetry Protocol Exporter
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.exporter.internal.otlp.metrics;
import io.opentelemetry.exporter.internal.marshal.MarshalerContext;
import io.opentelemetry.exporter.internal.marshal.Serializer;
import io.opentelemetry.exporter.internal.marshal.StatelessMarshaler;
import io.opentelemetry.proto.metrics.v1.internal.SummaryDataPoint;
import io.opentelemetry.sdk.metrics.data.ValueAtQuantile;
import java.io.IOException;
/** See {@link ValueAtQuantileMarshaler}. */
final class ValueAtQuantileStatelessMarshaler implements StatelessMarshaler {
static final ValueAtQuantileStatelessMarshaler INSTANCE = new ValueAtQuantileStatelessMarshaler();
private ValueAtQuantileStatelessMarshaler() {}
@Override
public void writeTo(Serializer output, ValueAtQuantile value, MarshalerContext context)
throws IOException {
output.serializeDouble(SummaryDataPoint.ValueAtQuantile.QUANTILE, value.getQuantile());
output.serializeDouble(SummaryDataPoint.ValueAtQuantile.VALUE, value.getValue());
}
@Override
public int getBinarySerializedSize(ValueAtQuantile value, MarshalerContext context) {
return ValueAtQuantileMarshaler.calculateSize(value.getQuantile(), value.getValue());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy