Skip to content

Commit db819be

Browse files
authored
Fix some metric bugs
1 parent 2b641fd commit db819be

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/schedule/queue/IndexedBlockingReserveQueue.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ public synchronized void push(E element) {
5454
if (element == null) {
5555
throw new NullPointerException("pushed element is null");
5656
}
57-
Preconditions.checkState(
58-
size + reservedSize < capacity, "The system can't allow more query tasks.");
57+
Preconditions.checkState(size + reservedSize < capacity, TOO_MANY_CONCURRENT_QUERIES_ERROR_MSG);
5958
pushToQueue(element);
6059
size++;
6160
this.notifyAll();

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/metric/DriverSchedulerMetricSet.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,6 @@ public void bindTo(AbstractMetricService metricService) {
8888
DriverScheduler::getQueryMapSize,
8989
Tag.NAME.toString(),
9090
QUERY_MAP_SIZE);
91-
metricService.remove(
92-
MetricType.AUTO_GAUGE,
93-
Metric.DRIVER_SCHEDULER.toString(),
94-
Tag.NAME.toString(),
95-
TIMEOUT_QUEUE_SIZE);
96-
metricService.remove(
97-
MetricType.AUTO_GAUGE,
98-
Metric.DRIVER_SCHEDULER.toString(),
99-
Tag.NAME.toString(),
100-
QUERY_MAP_SIZE);
10191
}
10292

10393
@Override
@@ -124,6 +114,16 @@ public void unbindFrom(AbstractMetricService metricService) {
124114
Metric.DRIVER_SCHEDULER.toString(),
125115
Tag.NAME.toString(),
126116
BLOCK_QUEUE_TASK_COUNT);
117+
metricService.remove(
118+
MetricType.AUTO_GAUGE,
119+
Metric.DRIVER_SCHEDULER.toString(),
120+
Tag.NAME.toString(),
121+
TIMEOUT_QUEUE_SIZE);
122+
metricService.remove(
123+
MetricType.AUTO_GAUGE,
124+
Metric.DRIVER_SCHEDULER.toString(),
125+
Tag.NAME.toString(),
126+
QUERY_MAP_SIZE);
127127
}
128128

129129
public void recordTaskQueueTime(String name, long queueTimeInNanos) {

0 commit comments

Comments
 (0)