1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-02-03 13:11:53 +02:00

Remove commented out method in exponential_histogram.go (#4429)

This commit is contained in:
Tyler Yahn 2023-08-10 00:23:25 -07:00 committed by GitHub
parent d9afe946d4
commit b44a2bbc36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -393,6 +393,7 @@ func (e *expoHistogram[N]) delta(dest *metricdata.Aggregation) int {
*dest = h *dest = h
return n return n
} }
func (e *expoHistogram[N]) cumulative(dest *metricdata.Aggregation) int { func (e *expoHistogram[N]) cumulative(dest *metricdata.Aggregation) int {
t := now() t := now()
@ -443,55 +444,3 @@ func (e *expoHistogram[N]) cumulative(dest *metricdata.Aggregation) int {
*dest = h *dest = h
return n return n
} }
// Aggregate records the measurement, scoped by attr, and aggregates it
// into an aggregation.
// func (e *cumulativeExponentialHistogram[N]) Aggregation() metricdata.Aggregation {
// e.valuesMu.Lock()
// defer e.valuesMu.Unlock()
// if len(e.values) == 0 {
// return nil
// }
// t := now()
// h := metricdata.ExponentialHistogram[N]{
// Temporality: metricdata.CumulativeTemporality,
// DataPoints: make([]metricdata.ExponentialHistogramDataPoint[N], 0, len(e.values)),
// }
// for a, b := range e.values {
// ehdp := metricdata.ExponentialHistogramDataPoint[N]{
// Attributes: a,
// StartTime: e.start,
// Time: t,
// Count: b.count,
// Scale: int32(b.scale),
// ZeroCount: b.zeroCount,
// ZeroThreshold: 0.0,
// PositiveBucket: metricdata.ExponentialBucket{
// Offset: int32(b.posBuckets.startBin),
// Counts: make([]uint64, len(b.posBuckets.counts)),
// },
// NegativeBucket: metricdata.ExponentialBucket{
// Offset: int32(b.negBuckets.startBin),
// Counts: make([]uint64, len(b.negBuckets.counts)),
// },
// }
// copy(ehdp.PositiveBucket.Counts, b.posBuckets.counts)
// copy(ehdp.NegativeBucket.Counts, b.negBuckets.counts)
// if !e.noMinMax {
// ehdp.Min = metricdata.NewExtrema(b.min)
// ehdp.Max = metricdata.NewExtrema(b.max)
// }
// if !e.noSum {
// ehdp.Sum = b.sum
// }
// h.DataPoints = append(h.DataPoints, ehdp)
// // TODO (#3006): This will use an unbounded amount of memory if there
// // are unbounded number of attribute sets being aggregated. Attribute
// // sets that become "stale" need to be forgotten so this will not
// // overload the system.
// }
// return h
// }