| 273 | } |
| 274 | |
| 275 | type summary struct { |
| 276 | selfCollector |
| 277 | |
| 278 | bufMtx sync.Mutex // Protects hotBuf and hotBufExpTime. |
| 279 | mtx sync.Mutex // Protects every other moving part. |
| 280 | // Lock bufMtx before mtx if both are needed. |
| 281 | |
| 282 | desc *Desc |
| 283 | |
| 284 | now func() time.Time |
| 285 | |
| 286 | objectives map[float64]float64 |
| 287 | sortedObjectives []float64 |
| 288 | |
| 289 | labelPairs []*dto.LabelPair |
| 290 | |
| 291 | sum float64 |
| 292 | cnt uint64 |
| 293 | |
| 294 | hotBuf, coldBuf []float64 |
| 295 | |
| 296 | streams []*quantile.Stream |
| 297 | streamDuration time.Duration |
| 298 | headStream *quantile.Stream |
| 299 | headStreamIdx int |
| 300 | headStreamExpTime, hotBufExpTime time.Time |
| 301 | |
| 302 | createdTs *timestamppb.Timestamp |
| 303 | } |
| 304 | |
| 305 | func (s *summary) Desc() *Desc { |
| 306 | return s.desc |
nothing calls this directly
no outgoing calls
no test coverage detected