mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-24 17:51:14 +02:00
feat: using histogram metrics
This commit is contained in:
parent
145def0f25
commit
78255edb96
@ -75,6 +75,7 @@ export class BatchHistogram {
|
||||
|
||||
reset(): void {
|
||||
this.store.clear();
|
||||
this.bucketBoundaries.clear();
|
||||
}
|
||||
|
||||
get() {
|
||||
|
@ -59,6 +59,10 @@ export class MetricsTranslator {
|
||||
): boolean {
|
||||
const existingBoundaries = existingHistogram.bucketBoundaries;
|
||||
|
||||
if (existingBoundaries.size !== newBuckets.length) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const bucket of newBuckets) {
|
||||
if (!existingBoundaries.has(bucket.le)) {
|
||||
return true;
|
||||
@ -184,6 +188,7 @@ export class MetricsTranslator {
|
||||
if (existingMetric && existingMetric instanceof BatchHistogram) {
|
||||
const firstSample = metric.samples[0]; // all samples should have same buckets
|
||||
const needsRecreation =
|
||||
!firstSample?.buckets ||
|
||||
this.hasNewLabels(existingMetric, labelNames) ||
|
||||
this.hasNewBuckets(existingMetric, firstSample.buckets);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user