Skip to content

Commit

Permalink
Remove commented out method in exponential_histogram.go (#4429)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Aug 10, 2023
1 parent d9afe94 commit b44a2bb
Showing 1 changed file with 1 addition and 52 deletions.
53 changes: 1 addition & 52 deletions sdk/metric/internal/aggregate/exponential_histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ func (e *expoHistogram[N]) delta(dest *metricdata.Aggregation) int {
*dest = h
return n
}

func (e *expoHistogram[N]) cumulative(dest *metricdata.Aggregation) int {
t := now()

Expand Down Expand Up @@ -443,55 +444,3 @@ func (e *expoHistogram[N]) cumulative(dest *metricdata.Aggregation) int {
*dest = h
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
// }

0 comments on commit b44a2bb

Please sign in to comment.