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

Method zero

lib/histogram.js:136–143  ·  view source on GitHub ↗

* Initialize the metrics for the given combination of labels to zero * @param {object} labels - Object with labels where key is the label key and value is label value. Can only be one level deep * @returns {void}

(labels)

Source from the content-addressed store, hash-verified

134 * @returns {void}
135 */
136 zero(labels) {
137 const hash = hashObject(labels, this.sortedLabelNames);
138 this.hashMap[hash] = createBaseValues(
139 labels,
140 this.bucketValues,
141 this.bucketExemplars,
142 );
143 }
144
145 /**
146 * Start a timer that could be used to logging durations

Callers 1

histogramTest.jsFile · 0.80

Calls 2

hashObjectFunction · 0.85
createBaseValuesFunction · 0.85

Tested by

no test coverage detected