001package io.prometheus.metrics.exporter.opentelemetry.otelmodel; 002 003import io.opentelemetry.api.common.Attributes; 004import io.opentelemetry.sdk.metrics.data.DoubleExemplarData; 005import io.opentelemetry.sdk.metrics.data.HistogramPointData; 006import java.util.List; 007 008public class HistogramPointDataImpl extends PointDataImpl implements HistogramPointData { 009 010 private final double sum; 011 private final long count; 012 private final double min; 013 private final double max; 014 private final List<Double> boundaries; 015 private final List<Long> counts; 016 017 public HistogramPointDataImpl( 018 double sum, 019 long count, 020 double min, 021 double max, 022 List<Double> boundaries, 023 List<Long> counts, 024 long startEpochNanos, 025 long epochNanos, 026 Attributes attributes, 027 List<DoubleExemplarData> exemplars) { 028 super(startEpochNanos, epochNanos, attributes, exemplars); 029 this.sum = sum; 030 this.count = count; 031 this.min = min; 032 this.max = max; 033 this.boundaries = boundaries; 034 this.counts = counts; 035 } 036 037 @Override 038 public double getSum() { 039 return sum; 040 } 041 042 @Override 043 public long getCount() { 044 return count; 045 } 046 047 @Override 048 public boolean hasMin() { 049 return !Double.isNaN(min); 050 } 051 052 @Override 053 public double getMin() { 054 return min; 055 } 056 057 @Override 058 public boolean hasMax() { 059 return !Double.isNaN(max); 060 } 061 062 @Override 063 public double getMax() { 064 return max; 065 } 066 067 @Override 068 public List<Double> getBoundaries() { 069 return boundaries; 070 } 071 072 @Override 073 public List<Long> getCounts() { 074 return counts; 075 } 076}