MCPcopy Index your code
hub / github.com/prometheus/client_js / extractBucketValuesForExport

Function extractBucketValuesForExport

lib/histogram.js:290–308  ·  view source on GitHub ↗
(histogram)

Source from the content-addressed store, hash-verified

288}
289
290function extractBucketValuesForExport(histogram) {
291 const name = `${histogram.name}_bucket`;
292 return bucketData => {
293 let acc = 0;
294 const buckets = histogram.upperBounds.map(upperBound => {
295 acc += bucketData.bucketValues[upperBound];
296 return setValuePair(
297 { le: upperBound },
298 acc,
299 name,
300 bucketData.bucketExemplars
301 ? bucketData.bucketExemplars[upperBound]
302 : null,
303 bucketData.labels,
304 );
305 });
306 return { buckets, data: bucketData };
307 };
308}
309
310function addSumAndCountForExport(histogram) {
311 return (acc, d) => {

Callers 1

getForPromStringMethod · 0.85

Calls 1

setValuePairFunction · 0.85

Tested by

no test coverage detected