Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove time series before adding it #766

Merged
merged 1 commit into from Jan 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2370,6 +2370,7 @@ private void initMetricsCollection(MetricRegistry metricRegistry, List<LabelValu

// The value of a maxSessionsInUse is observed from a callback function. This function is
// invoked whenever metrics are collected.
maxInUseSessionsMetric.removeTimeSeries(labelValues);
maxInUseSessionsMetric.createTimeSeries(
labelValues,
this,
Expand All @@ -2382,6 +2383,7 @@ public long applyAsLong(SessionPool sessionPool) {

// The value of a maxSessions is observed from a callback function. This function is invoked
// whenever metrics are collected.
maxAllowedSessionsMetric.removeTimeSeries(labelValues);
maxAllowedSessionsMetric.createTimeSeries(
labelValues,
options,
Expand All @@ -2394,6 +2396,7 @@ public long applyAsLong(SessionPoolOptions options) {

// The value of a numWaiterTimeouts is observed from a callback function. This function is
// invoked whenever metrics are collected.
sessionsTimeouts.removeTimeSeries(labelValues);
sessionsTimeouts.createTimeSeries(
labelValues,
this,
Expand All @@ -2404,6 +2407,7 @@ public long applyAsLong(SessionPool sessionPool) {
}
});

numAcquiredSessionsMetric.removeTimeSeries(labelValues);
numAcquiredSessionsMetric.createTimeSeries(
labelValues,
this,
Expand All @@ -2414,6 +2418,7 @@ public long applyAsLong(SessionPool sessionPool) {
}
});

numReleasedSessionsMetric.removeTimeSeries(labelValues);
numReleasedSessionsMetric.createTimeSeries(
labelValues,
this,
Expand All @@ -2426,6 +2431,7 @@ public long applyAsLong(SessionPool sessionPool) {

List<LabelValue> labelValuesWithBeingPreparedType = new ArrayList<>(labelValues);
labelValuesWithBeingPreparedType.add(NUM_SESSIONS_BEING_PREPARED);
numSessionsInPoolMetric.removeTimeSeries(labelValuesWithBeingPreparedType);
numSessionsInPoolMetric.createTimeSeries(
labelValuesWithBeingPreparedType,
this,
Expand All @@ -2439,6 +2445,7 @@ public long applyAsLong(SessionPool sessionPool) {

List<LabelValue> labelValuesWithInUseType = new ArrayList<>(labelValues);
labelValuesWithInUseType.add(NUM_IN_USE_SESSIONS);
numSessionsInPoolMetric.removeTimeSeries(labelValuesWithInUseType);
numSessionsInPoolMetric.createTimeSeries(
labelValuesWithInUseType,
this,
Expand All @@ -2451,6 +2458,7 @@ public long applyAsLong(SessionPool sessionPool) {

List<LabelValue> labelValuesWithReadType = new ArrayList<>(labelValues);
labelValuesWithReadType.add(NUM_READ_SESSIONS);
numSessionsInPoolMetric.removeTimeSeries(labelValuesWithReadType);
numSessionsInPoolMetric.createTimeSeries(
labelValuesWithReadType,
this,
Expand All @@ -2463,6 +2471,7 @@ public long applyAsLong(SessionPool sessionPool) {

List<LabelValue> labelValuesWithWriteType = new ArrayList<>(labelValues);
labelValuesWithWriteType.add(NUM_WRITE_SESSIONS);
numSessionsInPoolMetric.removeTimeSeries(labelValuesWithWriteType);
numSessionsInPoolMetric.createTimeSeries(
labelValuesWithWriteType,
this,
Expand Down