Skip to content

Commit e95acfd

Browse files
committed
fix
Signed-off-by: Weihao Li <[email protected]>
1 parent 79e10af commit e95acfd

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/informationschema/IoTDBCurrentQueriesIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public static void tearDown() throws Exception {
7676
@Test
7777
public void testCurrentQueries() {
7878
try {
79+
Assert.assertEquals(3, QUERIES_COSTS_HISTOGRAM_COLUMN_NUM);
80+
7981
Connection connection =
8082
EnvFactory.getEnv().getConnection(ADMIN_NAME, ADMIN_PWD, BaseEnv.TABLE_SQL_DIALECT);
8183
Statement statement = connection.createStatement();

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/InformationSchemaContentSupplierFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,7 @@ private QueriesCostsHistogramSupplier(
13321332
protected void constructLine() {
13331333
columnBuilders[0].writeBinary(BUCKETS[nextConsumedIndex]);
13341334
columnBuilders[1].writeInt(currentQueriesCostHistogram[nextConsumedIndex]);
1335+
columnBuilders[2].writeInt(QueryId.getDataNodeId());
13351336
resultBuilder.declarePosition();
13361337
nextConsumedIndex++;
13371338
}

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/metrics/memory/QueryEngineMemoryMetrics.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,17 @@ public void bindTo(AbstractMetricService metricService) {
200200
GlobalMemoryMetrics.ON_HEAP,
201201
Tag.LEVEL.toString(),
202202
GlobalMemoryMetrics.LEVELS[2]);
203-
// TODO @spricoder: CoordinatorMemoryManager are not used
203+
metricService.createAutoGauge(
204+
Metric.MEMORY_ACTUAL_SIZE.toString(),
205+
MetricLevel.IMPORTANT,
206+
memoryConfig.getCoordinatorMemoryManager(),
207+
MemoryManager::getUsedMemorySizeInBytes,
208+
Tag.NAME.toString(),
209+
QUERY_ENGINE_COORDINATOR,
210+
Tag.TYPE.toString(),
211+
GlobalMemoryMetrics.ON_HEAP,
212+
Tag.LEVEL.toString(),
213+
GlobalMemoryMetrics.LEVELS[2]);
204214
}
205215

206216
@Override

iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/schema/table/InformationSchema.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ public class InformationSchema {
390390
new TagColumnSchema(ColumnHeaderConstant.BIN, TSDataType.STRING));
391391
queriesCostsHistogramTable.addColumnSchema(
392392
new AttributeColumnSchema(ColumnHeaderConstant.NUMS, TSDataType.INT32));
393+
queriesCostsHistogramTable.addColumnSchema(
394+
new AttributeColumnSchema(ColumnHeaderConstant.DATANODE_ID, TSDataType.INT32));
393395
queriesCostsHistogramTable.removeColumnSchema(TsTable.TIME_COLUMN_NAME);
394396
schemaTables.put(QUERIES_COSTS_HISTOGRAM, queriesCostsHistogramTable);
395397
}

0 commit comments

Comments
 (0)