Skip to content

Commit d7bbfcb

Browse files
committed
fixed cell resevoir lookup
1 parent ff3c2a7 commit d7bbfcb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/OpenTelemetrySdk/Metrics/Stable/Exemplar/HistogramExemplarReservoir.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import OpenTelemetryApi
88

99
public class HistogramExemplarReservoir : FixedSizedExemplarReservoir {
1010
init(clock: Clock, boundries : [Double]) {
11-
// unsafeBitCast(ReservoirCell.getAndResetDouble, to: ((ReservoirCell, [String: AttributeValue]) -> ImmutableDoubleExemplarData).self)
12-
super.init(clock: clock, size: boundries.count + 1, reservoirCellSelector: HistogramCellSelector(boundries: boundries), mapAndResetCell: unsafeBitCast(ReservoirCell.getAndResetDouble, to: ((ReservoirCell, [String: AttributeValue])-> ImmutableDoubleExemplarData).self))
11+
super.init(clock: clock, size: boundries.count + 1, reservoirCellSelector: HistogramCellSelector(boundries: boundries), mapAndResetCell: { cell, attributes in
12+
return cell.getAndResetDouble(pointAttributes: attributes)
13+
})
1314
}
1415

1516
override public func offerLongMeasurement(value: Int, attributes: [String : AttributeValue]) {

0 commit comments

Comments
 (0)