(histogram)
| 308 | } |
| 309 | |
| 310 | function addSumAndCountForExport(histogram) { |
| 311 | return (acc, d) => { |
| 312 | acc.push(...d.buckets); |
| 313 | |
| 314 | const infLabel = { le: '+Inf' }; |
| 315 | acc.push( |
| 316 | setValuePair( |
| 317 | infLabel, |
| 318 | d.data.count, |
| 319 | `${histogram.name}_bucket`, |
| 320 | d.data.bucketExemplars ? d.data.bucketExemplars['-1'] : null, |
| 321 | d.data.labels, |
| 322 | ), |
| 323 | setValuePair( |
| 324 | {}, |
| 325 | d.data.sum, |
| 326 | `${histogram.name}_sum`, |
| 327 | undefined, |
| 328 | d.data.labels, |
| 329 | ), |
| 330 | setValuePair( |
| 331 | {}, |
| 332 | d.data.count, |
| 333 | `${histogram.name}_count`, |
| 334 | undefined, |
| 335 | d.data.labels, |
| 336 | ), |
| 337 | ); |
| 338 | return acc; |
| 339 | }; |
| 340 | } |
| 341 | |
| 342 | function splayLabels(bucket) { |
| 343 | const { sharedLabels, labels, ...newBucket } = bucket; |
no test coverage detected