NewHistogramData returns a new instance of HistogramData with properly initialized fields.
(bounds []float64)
| 709 | |
| 710 | // NewHistogramData returns a new instance of HistogramData with properly initialized fields. |
| 711 | func NewHistogramData(bounds []float64) *HistogramData { |
| 712 | return &HistogramData{ |
| 713 | Bounds: bounds, |
| 714 | CountPerBucket: make([]int64, len(bounds)+1), |
| 715 | Max: 0, |
| 716 | Min: math.MaxInt64, |
| 717 | } |
| 718 | } |
| 719 | |
| 720 | // Update changes the Min and Max fields if value is less than or greater than the current values. |
| 721 | func (histogram *HistogramData) Update(value int64) { |