MCPcopy
hub / github.com/prometheus/client_js / getValueByLabel

Function getValueByLabel

test/exemplarsTest.js:243–250  ·  view source on GitHub ↗
(label, values, key)

Source from the content-addressed store, hash-verified

241 });
242
243 function getValueByLabel(label, values, key) {
244 return values.reduce((acc, val) => {
245 if (val.labels && val.labels[key || 'le'] === label) {
246 acc = val;
247 }
248 return acc;
249 }, {});
250 }
251 function getValuesByLabel(label, values, key) {
252 return values.reduce((acc, val) => {
253 if (val.labels && val.labels[key || 'le'] === label) {

Callers 1

exemplarsTest.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected