@@ -2370,6 +2370,7 @@ private void initMetricsCollection(MetricRegistry metricRegistry, List<LabelValu
2370
2370
2371
2371
// The value of a maxSessionsInUse is observed from a callback function. This function is
2372
2372
// invoked whenever metrics are collected.
2373
+ maxInUseSessionsMetric .removeTimeSeries (labelValues );
2373
2374
maxInUseSessionsMetric .createTimeSeries (
2374
2375
labelValues ,
2375
2376
this ,
@@ -2382,6 +2383,7 @@ public long applyAsLong(SessionPool sessionPool) {
2382
2383
2383
2384
// The value of a maxSessions is observed from a callback function. This function is invoked
2384
2385
// whenever metrics are collected.
2386
+ maxAllowedSessionsMetric .removeTimeSeries (labelValues );
2385
2387
maxAllowedSessionsMetric .createTimeSeries (
2386
2388
labelValues ,
2387
2389
options ,
@@ -2394,6 +2396,7 @@ public long applyAsLong(SessionPoolOptions options) {
2394
2396
2395
2397
// The value of a numWaiterTimeouts is observed from a callback function. This function is
2396
2398
// invoked whenever metrics are collected.
2399
+ sessionsTimeouts .removeTimeSeries (labelValues );
2397
2400
sessionsTimeouts .createTimeSeries (
2398
2401
labelValues ,
2399
2402
this ,
@@ -2404,6 +2407,7 @@ public long applyAsLong(SessionPool sessionPool) {
2404
2407
}
2405
2408
});
2406
2409
2410
+ numAcquiredSessionsMetric .removeTimeSeries (labelValues );
2407
2411
numAcquiredSessionsMetric .createTimeSeries (
2408
2412
labelValues ,
2409
2413
this ,
@@ -2414,6 +2418,7 @@ public long applyAsLong(SessionPool sessionPool) {
2414
2418
}
2415
2419
});
2416
2420
2421
+ numReleasedSessionsMetric .removeTimeSeries (labelValues );
2417
2422
numReleasedSessionsMetric .createTimeSeries (
2418
2423
labelValues ,
2419
2424
this ,
@@ -2426,6 +2431,7 @@ public long applyAsLong(SessionPool sessionPool) {
2426
2431
2427
2432
List <LabelValue > labelValuesWithBeingPreparedType = new ArrayList <>(labelValues );
2428
2433
labelValuesWithBeingPreparedType .add (NUM_SESSIONS_BEING_PREPARED );
2434
+ numSessionsInPoolMetric .removeTimeSeries (labelValuesWithBeingPreparedType );
2429
2435
numSessionsInPoolMetric .createTimeSeries (
2430
2436
labelValuesWithBeingPreparedType ,
2431
2437
this ,
@@ -2439,6 +2445,7 @@ public long applyAsLong(SessionPool sessionPool) {
2439
2445
2440
2446
List <LabelValue > labelValuesWithInUseType = new ArrayList <>(labelValues );
2441
2447
labelValuesWithInUseType .add (NUM_IN_USE_SESSIONS );
2448
+ numSessionsInPoolMetric .removeTimeSeries (labelValuesWithInUseType );
2442
2449
numSessionsInPoolMetric .createTimeSeries (
2443
2450
labelValuesWithInUseType ,
2444
2451
this ,
@@ -2451,6 +2458,7 @@ public long applyAsLong(SessionPool sessionPool) {
2451
2458
2452
2459
List <LabelValue > labelValuesWithReadType = new ArrayList <>(labelValues );
2453
2460
labelValuesWithReadType .add (NUM_READ_SESSIONS );
2461
+ numSessionsInPoolMetric .removeTimeSeries (labelValuesWithReadType );
2454
2462
numSessionsInPoolMetric .createTimeSeries (
2455
2463
labelValuesWithReadType ,
2456
2464
this ,
@@ -2463,6 +2471,7 @@ public long applyAsLong(SessionPool sessionPool) {
2463
2471
2464
2472
List <LabelValue > labelValuesWithWriteType = new ArrayList <>(labelValues );
2465
2473
labelValuesWithWriteType .add (NUM_WRITE_SESSIONS );
2474
+ numSessionsInPoolMetric .removeTimeSeries (labelValuesWithWriteType );
2466
2475
numSessionsInPoolMetric .createTimeSeries (
2467
2476
labelValuesWithWriteType ,
2468
2477
this ,
0 commit comments