You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2019/04/15 13:58:22 UTC

[incubator-iotdb] branch instrumentation_for_hashmap created (now a481836)

This is an automated email from the ASF dual-hosted git repository.

jiangtian pushed a change to branch instrumentation_for_hashmap
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


      at a481836  add instrumentor of HashMap

This branch includes the following new commits:

     new a481836  add instrumentor of HashMap

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[incubator-iotdb] 01/01: add instrumentor of HashMap

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jiangtian pushed a commit to branch instrumentation_for_hashmap
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git

commit a4818367684166b9be7ffcd5f4bbecbdf1faf2db
Author: 江天 <jt...@163.com>
AuthorDate: Mon Apr 15 21:57:08 2019 +0800

    add instrumentor of HashMap
---
 .../db/engine/filenode/FileNodeProcessor.java      | 20 ++++++++
 .../db/engine/filenode/FileNodeProcessorStore.java |  3 ++
 .../db/engine/memtable/PrimitiveMemTable.java      |  2 +
 .../db/engine/overflow/io/OverflowResource.java    |  4 ++
 .../java/org/apache/iotdb/db/metadata/MGraph.java  |  4 ++
 .../org/apache/iotdb/db/metadata/MManager.java     |  2 +
 .../java/org/apache/iotdb/db/metadata/MNode.java   |  3 ++
 .../java/org/apache/iotdb/db/metadata/MTree.java   |  3 ++
 .../java/org/apache/iotdb/db/metadata/PNode.java   |  2 +
 .../java/org/apache/iotdb/db/metadata/PTree.java   |  2 +
 .../apache/iotdb/db/monitor/MonitorConstants.java  |  2 +
 .../iotdb/db/qp/strategy/LogicalGenerator.java     |  4 ++
 .../iotdb/db/query/context/QueryContext.java       |  8 +++-
 .../java/org/apache/iotdb/db/service/IoTDB.java    |  4 +-
 .../org/apache/iotdb/db/service/TSServiceImpl.java |  4 ++
 .../tsfile/qp/optimizer/PhysicalOptimizer.java     |  1 +
 .../tsfile/encoding/decoder/BitmapDecoder.java     |  2 +
 .../iotdb/tsfile/expr/HashMapInstrumentor.java     | 55 ++++++++++++++++++++++
 .../iotdb/tsfile/file/metadata/TsDigest.java       |  4 ++
 .../iotdb/tsfile/file/metadata/TsFileMetaData.java |  7 +++
 .../apache/iotdb/tsfile/write/TsFileWriter.java    |  7 +++
 .../tsfile/write/chunk/ChunkGroupWriterImpl.java   |  2 +
 .../iotdb/tsfile/write/schema/FileSchema.java      |  2 +
 .../iotdb/tsfile/write/schema/JsonConverter.java   |  3 ++
 .../tsfile/write/schema/MeasurementSchema.java     |  4 ++
 .../iotdb/tsfile/write/writer/TsFileIOWriter.java  |  3 ++
 26 files changed, 155 insertions(+), 2 deletions(-)

diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
index 47aca8e..0cdb34c 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
@@ -86,6 +86,7 @@ import org.apache.iotdb.db.utils.QueryUtils;
 import org.apache.iotdb.db.utils.TimeValuePair;
 import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
 import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.footer.ChunkGroupFooter;
 import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
@@ -161,6 +162,8 @@ public class FileNodeProcessor extends Processor implements IStatistic {
     synchronized (fileNodeProcessorStore) {
       // deep copy
       Map<String, Long> tempLastUpdateMap = new HashMap<>(lastUpdateTimeMap);
+      HashMapInstrumentor.incCount(this.getClass());
+
       // update flushLastUpdateTimeMap
       for (Entry<String, Long> entry : lastUpdateTimeMap.entrySet()) {
         flushLastUpdateTimeMap.put(entry.getKey(), entry.getValue() + 1);
@@ -185,6 +188,8 @@ public class FileNodeProcessor extends Processor implements IStatistic {
       if (!newFileNodes.isEmpty()) {
         // end time with one start time
         Map<String, Long> endTimeMap = new HashMap<>();
+        HashMapInstrumentor.incCount(this.getClass());
+
         for (Entry<String, Long> startTime : currentTsFileResource.getStartTimeMap().entrySet()) {
           String deviceId = startTime.getKey();
           endTimeMap.put(deviceId, lastUpdateTimeMap.get(deviceId));
@@ -226,6 +231,7 @@ public class FileNodeProcessor extends Processor implements IStatistic {
   FileNodeProcessor(String fileNodeDirPath, String processorName)
       throws FileNodeProcessorException {
     super(processorName);
+    HashMapInstrumentor.incCount(this.getClass());
     for (MonitorConstants.FileNodeProcessorStatConstants statConstant :
         MonitorConstants.FileNodeProcessorStatConstants.values()) {
       statParamsHashMap.put(statConstant.name(), new AtomicLong(0));
@@ -236,6 +242,8 @@ public class FileNodeProcessor extends Processor implements IStatistic {
             + processorName.replaceAll("\\.", "_");
 
     this.parameters = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
+
     String dirPath = fileNodeDirPath;
     if (dirPath.length() > 0
         && dirPath.charAt(dirPath.length() - 1) != File.separatorChar) {
@@ -267,8 +275,12 @@ public class FileNodeProcessor extends Processor implements IStatistic {
     isMerging = fileNodeProcessorStore.getFileNodeProcessorStatus();
     numOfMergeFile = fileNodeProcessorStore.getNumOfMergeFile();
     invertedIndexOfFiles = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
+
     // deep clone
     flushLastUpdateTimeMap = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
+
     for (Entry<String, Long> entry : lastUpdateTimeMap.entrySet()) {
       flushLastUpdateTimeMap.put(entry.getKey(), entry.getValue() + 1);
     }
@@ -307,6 +319,8 @@ public class FileNodeProcessor extends Processor implements IStatistic {
   @Override
   public void registerStatMetadata() {
     Map<String, String> hashMap = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
+
     for (MonitorConstants.FileNodeProcessorStatConstants statConstant :
         MonitorConstants.FileNodeProcessorStatConstants.values()) {
       hashMap
@@ -331,6 +345,8 @@ public class FileNodeProcessor extends Processor implements IStatistic {
   public Map<String, TSRecord> getAllStatisticsValue() {
     Long curTime = System.currentTimeMillis();
     HashMap<String, TSRecord> tsRecordHashMap = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
+
     TSRecord tsRecord = new TSRecord(curTime, statStorageDeltaName);
 
     Map<String, AtomicLong> hashMap = getStatParamsHashMap();
@@ -521,6 +537,8 @@ public class FileNodeProcessor extends Processor implements IStatistic {
       throws FileNodeProcessorException {
     if (bufferWriteProcessor == null) {
       Map<String, Action> params = new HashMap<>();
+      HashMapInstrumentor.incCount(this.getClass());
+
       params.put(FileNodeConstants.BUFFERWRITE_FLUSH_ACTION, bufferwriteFlushAction);
       params.put(FileNodeConstants.BUFFERWRITE_CLOSE_ACTION, bufferwriteCloseAction);
       params
@@ -559,6 +577,8 @@ public class FileNodeProcessor extends Processor implements IStatistic {
   public OverflowProcessor getOverflowProcessor(String processorName) throws IOException {
     if (overflowProcessor == null) {
       Map<String, Action> params = new HashMap<>();
+      HashMapInstrumentor.incCount(this.getClass());
+
       // construct processor or restore
       params.put(FileNodeConstants.OVERFLOW_FLUSH_ACTION, overflowFlushAction);
       params
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessorStore.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessorStore.java
index 7c1eca4..7eacc6f 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessorStore.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessorStore.java
@@ -28,6 +28,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
 
 /**
@@ -95,6 +96,7 @@ public class FileNodeProcessorStore implements Serializable {
   public static FileNodeProcessorStore deSerialize(InputStream inputStream) throws IOException {
     boolean isOverflowed = ReadWriteIOUtils.readBool(inputStream);
     Map<String, Long> lastUpdateTimeMap = new HashMap<>();
+    HashMapInstrumentor.incCount(FileNodeProcessorStore.class);
     int size = ReadWriteIOUtils.readInt(inputStream);
     for (int i = 0; i < size; i++) {
       String path = ReadWriteIOUtils.readString(inputStream);
@@ -132,6 +134,7 @@ public class FileNodeProcessorStore implements Serializable {
   }
 
   public Map<String, Long> getLastUpdateTimeMap() {
+    HashMapInstrumentor.incCount(this.getClass());
     return new HashMap<>(lastUpdateTimeMap);
   }
 
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTable.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTable.java
index 455196a..68b254f 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTable.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTable.java
@@ -22,6 +22,7 @@ package org.apache.iotdb.db.engine.memtable;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 
 public class PrimitiveMemTable extends AbstractMemTable {
@@ -41,6 +42,7 @@ public class PrimitiveMemTable extends AbstractMemTable {
   @Override
   public IMemTable copy() {
     Map<String, Map<String, IWritableMemChunk>> newMap = new HashMap<>(getMemTableMap());
+    HashMapInstrumentor.incCount(this.getClass());
 
     return new PrimitiveMemTable(newMap);
   }
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java
index 17078f8..7ee23fb 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/io/OverflowResource.java
@@ -41,6 +41,7 @@ import org.apache.iotdb.db.query.context.QueryContext;
 import org.apache.iotdb.db.query.control.FileReaderManager;
 import org.apache.iotdb.db.utils.MemUtils;
 import org.apache.iotdb.db.utils.QueryUtils;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.ChunkGroupMetaData;
 import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
 import org.apache.iotdb.tsfile.file.metadata.TsDeviceMetadata;
@@ -75,6 +76,7 @@ public class OverflowResource {
   public OverflowResource(String parentPath, String dataPath, VersionController versionController)
       throws IOException {
     this.insertMetadatas = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
     this.appendInsertMetadatas = new ArrayList<>();
     this.parentPath = parentPath;
     this.dataPath = dataPath;
@@ -169,6 +171,7 @@ public class OverflowResource {
         String deviceId = rowGroupMetaData.getDeviceID();
         if (!insertMetadatas.containsKey(deviceId)) {
           insertMetadatas.put(deviceId, new HashMap<>());
+          HashMapInstrumentor.incCount(this.getClass());
         }
         for (ChunkMetaData chunkMetaData : rowGroupMetaData.getChunkMetaDataList()) {
           chunkMetaData.setVersion(rowGroupMetaData.getVersion());
@@ -303,6 +306,7 @@ public class OverflowResource {
                                  ChunkMetaData chunkMetaData) {
     if (!insertMetadatas.containsKey(deviceId)) {
       insertMetadatas.put(deviceId, new HashMap<>());
+      HashMapInstrumentor.incCount(this.getClass());
     }
     if (!insertMetadatas.get(deviceId).containsKey(measurementId)) {
       insertMetadatas.get(deviceId).put(measurementId, new ArrayList<>());
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MGraph.java b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MGraph.java
index 5cf2847..8df7d3a 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MGraph.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MGraph.java
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Map;
 import org.apache.iotdb.db.exception.MetadataArgsErrorException;
 import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -45,6 +46,7 @@ public class MGraph implements Serializable {
   public MGraph(String mtreeName) {
     mtree = new MTree(mtreeName);
     ptreeMap = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   /**
@@ -205,6 +207,7 @@ public class MGraph implements Serializable {
    */
   public Map<String, List<MeasurementSchema>> getSchemaForAllType() throws PathErrorException {
     Map<String, List<MeasurementSchema>> res = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
     List<String> typeList = mtree.getAllType();
     for (String type : typeList) {
       res.put(type, getSchemaForOneType("root." + type));
@@ -221,6 +224,7 @@ public class MGraph implements Serializable {
    */
   public Map<String, List<String>> getDeviceForAllType() throws PathErrorException {
     Map<String, List<String>> res = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
     ArrayList<String> types = mtree.getAllType();
     for (String type : types) {
       res.put(type, getDeviceForOneType(type));
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MManager.java b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MManager.java
index eef21ca..b38a374 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MManager.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MManager.java
@@ -41,6 +41,7 @@ import org.apache.iotdb.db.exception.PathErrorException;
 import org.apache.iotdb.db.utils.RandomDeleteCache;
 import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
 import org.apache.iotdb.tsfile.exception.cache.CacheException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -195,6 +196,7 @@ public class MManager {
         if (args.length > 5) {
           String[] kv = new String[2];
           props = new HashMap<>(args.length - 5 + 1, 1);
+          HashMapInstrumentor.incCount(this.getClass());
           leftArgs = new String[args.length - 5];
           for (int k = 5; k < args.length; k++) {
             kv = args[k].split("=");
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MNode.java b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MNode.java
index a6c98d6..66294d6 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MNode.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MNode.java
@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.Map;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -83,6 +84,8 @@ public class MNode implements Serializable {
     if (b) {
       schemaMap = new HashMap<>();
       numSchemaMap = new HashMap<>();
+      HashMapInstrumentor.incCount(this.getClass());
+      HashMapInstrumentor.incCount(this.getClass());
     } else {
       numSchemaMap = null;
       schemaMap = null;
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MTree.java b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MTree.java
index 2c7e5b0..43663da 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/metadata/MTree.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/metadata/MTree.java
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Map;
 import org.apache.iotdb.db.exception.PathErrorException;
 import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -710,6 +711,7 @@ public class MTree implements Serializable {
    */
   public HashMap<String, ArrayList<String>> getAllPath(String pathReg) throws PathErrorException {
     HashMap<String, ArrayList<String>> paths = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
     String[] nodes = pathReg.split(DOUB_SEPARATOR);
     if (nodes.length == 0 || !nodes[0].equals(getRoot().getName())) {
       throw new PathErrorException(String.format(SERIES_NOT_CORRECT, pathReg));
@@ -838,6 +840,7 @@ public class MTree implements Serializable {
     String path = getRoot().getName() + "." + type;
     checkPath(path);
     HashMap<String, Integer> deviceMap = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
     MNode typeNode = getRoot().getChild(type);
     putDeviceToMap(getRoot().getName(), typeNode, deviceMap);
     ArrayList<String> res = new ArrayList<>();
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/metadata/PNode.java b/iotdb/src/main/java/org/apache/iotdb/db/metadata/PNode.java
index 4986ee2..293078c 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/metadata/PNode.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/metadata/PNode.java
@@ -22,6 +22,7 @@ import java.io.Serializable;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 
 /**
  * PNode is the shorthand for "Property Node", which make up The {@code PTree}
@@ -45,6 +46,7 @@ public class PNode implements Serializable {
     this.isLeaf = isLeaf;
     if (!isLeaf) {
       setChildren(new HashMap<>());
+      HashMapInstrumentor.incCount(this.getClass());
     } else {
       linkedMTreePathMap = new LinkedHashMap<>();
     }
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/metadata/PTree.java b/iotdb/src/main/java/org/apache/iotdb/db/metadata/PTree.java
index 95080d8..2710e15 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/metadata/PTree.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/metadata/PTree.java
@@ -23,6 +23,7 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import org.apache.iotdb.db.exception.PathErrorException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 
 /**
  * "PTree" is the shorthand for "Property Tree". One {@code PTree} consists several {@code PNode}
@@ -162,6 +163,7 @@ public class PTree implements Serializable {
     String[] nodes = path.trim().split("\\.");
     PNode leaf = getLeaf(getRoot(), nodes, 0);
     HashMap<String, ArrayList<String>> res = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
 
     for (String MPath : leaf.getLinkedMTreePathMap().keySet()) {
       HashMap<String, ArrayList<String>> tr = getmTree().getAllPath(MPath);
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/monitor/MonitorConstants.java b/iotdb/src/main/java/org/apache/iotdb/db/monitor/MonitorConstants.java
index ec899c8..dc692d4 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/monitor/MonitorConstants.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/monitor/MonitorConstants.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.db.conf.IoTDBConfig;
 import org.apache.iotdb.db.conf.IoTDBDescriptor;
 import org.apache.iotdb.db.monitor.collector.FileSize;
 import org.apache.iotdb.db.service.Monitor;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 
 public class MonitorConstants {
 
@@ -57,6 +58,7 @@ public class MonitorConstants {
    */
   static HashMap<String, AtomicLong> initValues(String constantsType) {
     HashMap<String, AtomicLong> hashMap = new HashMap<>();
+    HashMapInstrumentor.incCount(Monitor.class);
     switch (constantsType) {
       case FILENODE_PROCESSOR_CONST:
         for (FileNodeProcessorStatConstants statConstant : FileNodeProcessorStatConstants
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
index c80ff1f..1d6bcde 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/LogicalGenerator.java
@@ -57,6 +57,7 @@ import org.apache.iotdb.db.sql.parse.Node;
 import org.apache.iotdb.db.sql.parse.TSParser;
 import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
 import org.apache.iotdb.tsfile.common.constant.SystemConstant;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -384,6 +385,7 @@ public class LogicalGenerator {
     }
     checkMetadataArgs(dataType, encodingType, compressor);
     Map<String, String> props = new HashMap<>(paramNode.getChildCount() - offset + 1, 1);
+    HashMapInstrumentor.incCount(this.getClass());
     while (offset < paramNode.getChildCount()) {
       AstNode node = paramNode.getChild(offset++);
       props.put(node.getChild(0).getText().toLowerCase(), node.getChild(1).getText());
@@ -696,6 +698,8 @@ public class LogicalGenerator {
     }
 
     Map<TSDataType, IFill> fillTypes = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
+
     int childNum = node.getChildCount();
     for (int i = 0; i < childNum; i++) {
       AstNode childNode = node.getChild(i);
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java b/iotdb/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java
index cfb06ad..6f37c90 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/query/context/QueryContext.java
@@ -26,6 +26,7 @@ import java.util.List;
 import java.util.Map;
 import org.apache.iotdb.db.engine.modification.Modification;
 import org.apache.iotdb.db.engine.modification.ModificationFile;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 
 /**
  * QueryContext contains the shared information with in a query.
@@ -47,6 +48,8 @@ public class QueryContext {
   private long jobId;
 
   public QueryContext() {
+    HashMapInstrumentor.incCount(this.getClass());
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   public QueryContext(long jobId) {
@@ -61,7 +64,10 @@ public class QueryContext {
       throws IOException {
 
     Map<String, List<Modification>> fileModifications =
-        filePathModCache.computeIfAbsent(modFile.getFilePath(), k -> new HashMap<>());
+        filePathModCache.computeIfAbsent(modFile.getFilePath(), k -> {
+          HashMapInstrumentor.incCount(QueryContext.class);
+          return new HashMap<>();
+        });
     List<Modification> pathModifications = fileModifications.get(path);
 
     if (pathModifications == null) {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDB.java b/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDB.java
index 6ea138b..5aee123 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDB.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDB.java
@@ -31,9 +31,9 @@ import org.apache.iotdb.db.exception.PathErrorException;
 import org.apache.iotdb.db.exception.RecoverException;
 import org.apache.iotdb.db.exception.StartupException;
 import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.db.metadata.MManager;
 import org.apache.iotdb.db.monitor.StatMonitor;
-import org.apache.iotdb.db.query.control.FileReaderManager;
 import org.apache.iotdb.db.sync.receiver.SyncServerManager;
 import org.apache.iotdb.db.writelog.manager.MultiFileLogNodeManager;
 import org.apache.iotdb.db.writelog.manager.WriteLogNodeManager;
@@ -58,6 +58,7 @@ public class IoTDB implements IoTDBMBean {
 
   public void active() {
     StartupChecks checks = new StartupChecks().withDefaultTest();
+    HashMapInstrumentor.start();
     try {
       checks.verify();
     } catch (StartupException e) {
@@ -126,6 +127,7 @@ public class IoTDB implements IoTDBMBean {
   @Override
   public void stop() throws FileNodeManagerException {
     deactivate();
+    HashMapInstrumentor.stop();
   }
 
   private void setUncaughtExceptionHandler() {
diff --git a/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java b/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
index a68f586..a3cfcc1 100644
--- a/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
+++ b/iotdb/src/main/java/org/apache/iotdb/db/service/TSServiceImpl.java
@@ -80,6 +80,7 @@ import org.apache.iotdb.service.rpc.thrift.TS_SessionHandle;
 import org.apache.iotdb.service.rpc.thrift.TS_Status;
 import org.apache.iotdb.service.rpc.thrift.TS_StatusCode;
 import org.apache.iotdb.tsfile.exception.filter.QueryFilterOptimizationException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.read.common.Path;
 import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
 import org.apache.thrift.TException;
@@ -155,6 +156,9 @@ public class TSServiceImpl implements TSIService.Iface, ServerContext {
   private void initForOneSession() {
     queryStatus.set(new HashMap<>());
     queryRet.set(new HashMap<>());
+    HashMapInstrumentor.incCount(this.getClass());
+    HashMapInstrumentor.incCount(this.getClass());
+
   }
 
   @Override
diff --git a/spark/src/main/java/org/apache/iotdb/tsfile/qp/optimizer/PhysicalOptimizer.java b/spark/src/main/java/org/apache/iotdb/tsfile/qp/optimizer/PhysicalOptimizer.java
index 57753ab..440b005 100644
--- a/spark/src/main/java/org/apache/iotdb/tsfile/qp/optimizer/PhysicalOptimizer.java
+++ b/spark/src/main/java/org/apache/iotdb/tsfile/qp/optimizer/PhysicalOptimizer.java
@@ -171,6 +171,7 @@ public class PhysicalOptimizer {
 
   private Map<String, Set<String>> mergeColumns(List<FilterOperator> columnFilterOperators) {
     Map<String, Set<String>> column_values_map = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
     for (FilterOperator filterOperator : columnFilterOperators) {
       Pair<String, Set<String>> column_values = mergeColumn(filterOperator);
       if (column_values != null && !column_values.right.isEmpty()) {
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/BitmapDecoder.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/BitmapDecoder.java
index b920e43..d0cbfe1 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/BitmapDecoder.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/decoder/BitmapDecoder.java
@@ -27,6 +27,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import org.apache.iotdb.tsfile.exception.encoding.TsFileDecodingException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
 import org.apache.iotdb.tsfile.utils.Binary;
 import org.apache.iotdb.tsfile.utils.Pair;
@@ -142,6 +143,7 @@ public class BitmapDecoder extends Decoder {
     }
     if (this.buffer == null) {
       this.buffer = new HashMap<>();
+      HashMapInstrumentor.incCount(this.getClass());
     } else {
       this.buffer.clear();
     }
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/expr/HashMapInstrumentor.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/expr/HashMapInstrumentor.java
new file mode 100644
index 0000000..62fb9a9
--- /dev/null
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/expr/HashMapInstrumentor.java
@@ -0,0 +1,55 @@
+package org.apache.iotdb.tsfile.expr;
+
+
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicLong;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class HashMapInstrumentor {
+
+  private static final Logger LOGGER = LoggerFactory.getLogger(HashMapInstrumentor.class);
+
+  private static final Map<Class, AtomicLong> newCounter = new ConcurrentHashMap<>();
+  private static Thread reportTimer;
+
+  public static void incCount(Class cls) {
+    AtomicLong count = newCounter.computeIfAbsent(cls, k -> new AtomicLong(0));
+    count.addAndGet(1);
+  }
+
+  public static void report() {
+    StringBuilder stringBuilder = new StringBuilder("\n");
+    long tot = 0;
+    for (Entry<Class, AtomicLong> entry : newCounter.entrySet()) {
+      long count = entry.getValue().get();
+      stringBuilder.append(entry.getKey().getSimpleName()).append(":").append(count).append("\n");
+      tot += count;
+    }
+    stringBuilder.append("total:").append(tot);
+    LOGGER.info("HashMap usage:\n{}", stringBuilder);
+  }
+
+  public static void start() {
+    reportTimer = new Thread(() -> {
+      while (true) {
+        try {
+          Thread.sleep(60*1000);
+        } catch (InterruptedException e) {
+          Thread.currentThread().interrupt();
+          return;
+        }
+        report();
+      }
+    });
+    reportTimer.start();
+  }
+
+  public static void stop() {
+    if (reportTimer != null) {
+      reportTimer.interrupt();
+    }
+  }
+}
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsDigest.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsDigest.java
index 869c2f4..15c77f7 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsDigest.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsDigest.java
@@ -26,6 +26,7 @@ import java.nio.ByteBuffer;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
 
 /**
@@ -67,6 +68,7 @@ public class TsDigest {
     int size = ReadWriteIOUtils.readInt(inputStream);
     if (size > 0) {
       Map<String, ByteBuffer> statistics = new HashMap<>();
+      HashMapInstrumentor.incCount(TsDigest.class);
       String key;
       ByteBuffer value;
       for (int i = 0; i < size; i++) {
@@ -92,6 +94,7 @@ public class TsDigest {
     int size = ReadWriteIOUtils.readInt(buffer);
     if (size > 0) {
       Map<String, ByteBuffer> statistics = new HashMap<>();
+      HashMapInstrumentor.incCount(TsDigest.class);
       String key;
       ByteBuffer value;
       for (int i = 0; i < size; i++) {
@@ -144,6 +147,7 @@ public class TsDigest {
   public void addStatistics(String key, ByteBuffer value) {
     if (statistics == null) {
       statistics = new HashMap<>();
+      HashMapInstrumentor.incCount(this.getClass());
     }
     statistics.put(key, value);
     serializedSize += Integer.BYTES + key.length() + Integer.BYTES + value.remaining();
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsFileMetaData.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsFileMetaData.java
index 3cf9f0b..8ec2424 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsFileMetaData.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/TsFileMetaData.java
@@ -25,6 +25,7 @@ import java.io.OutputStream;
 import java.nio.ByteBuffer;
 import java.util.HashMap;
 import java.util.Map;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
 import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
@@ -53,6 +54,8 @@ public class TsFileMetaData {
   private String createdBy;
 
   public TsFileMetaData() {
+    HashMapInstrumentor.incCount(this.getClass());
+    HashMapInstrumentor.incCount(this.getClass());
     //do nothing
   }
 
@@ -81,6 +84,7 @@ public class TsFileMetaData {
     int size = ReadWriteIOUtils.readInt(inputStream);
     if (size > 0) {
       Map<String, TsDeviceMetadataIndex> deviceMap = new HashMap<>();
+      HashMapInstrumentor.incCount(TsFileMetaData.class);
       String key;
       TsDeviceMetadataIndex value;
       for (int i = 0; i < size; i++) {
@@ -94,6 +98,7 @@ public class TsFileMetaData {
     size = ReadWriteIOUtils.readInt(inputStream);
     if (size > 0) {
       fileMetaData.measurementSchema = new HashMap<>();
+      HashMapInstrumentor.incCount(TsFileMetaData.class);
       String key;
       MeasurementSchema value;
       for (int i = 0; i < size; i++) {
@@ -124,6 +129,7 @@ public class TsFileMetaData {
     int size = ReadWriteIOUtils.readInt(buffer);
     if (size > 0) {
       Map<String, TsDeviceMetadataIndex> deviceMap = new HashMap<>();
+      HashMapInstrumentor.incCount(TsFileMetaData.class);
       String key;
       TsDeviceMetadataIndex value;
       for (int i = 0; i < size; i++) {
@@ -137,6 +143,7 @@ public class TsFileMetaData {
     size = ReadWriteIOUtils.readInt(buffer);
     if (size > 0) {
       fileMetaData.measurementSchema = new HashMap<>();
+      HashMapInstrumentor.incCount(TsFileMetaData.class);
       String key;
       MeasurementSchema value;
       for (int i = 0; i < size; i++) {
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/TsFileWriter.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/TsFileWriter.java
index c66b1e6..25ddff9 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/TsFileWriter.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/TsFileWriter.java
@@ -28,6 +28,7 @@ import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
 import org.apache.iotdb.tsfile.common.conf.TSFileDescriptor;
 import org.apache.iotdb.tsfile.exception.write.NoMeasurementException;
 import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.footer.ChunkGroupFooter;
 import org.apache.iotdb.tsfile.write.chunk.ChunkGroupWriterImpl;
 import org.apache.iotdb.tsfile.write.chunk.IChunkGroupWriter;
@@ -86,6 +87,7 @@ public class TsFileWriter {
    */
   public TsFileWriter(File file) throws IOException {
     this(new TsFileIOWriter(file), new FileSchema(), TSFileDescriptor.getInstance().getConfig());
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   /**
@@ -95,6 +97,7 @@ public class TsFileWriter {
    */
   public TsFileWriter(TsFileIOWriter fileWriter) throws IOException {
     this(fileWriter, new FileSchema(), TSFileDescriptor.getInstance().getConfig());
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   /**
@@ -105,6 +108,7 @@ public class TsFileWriter {
    */
   public TsFileWriter(File file, FileSchema schema) throws IOException {
     this(new TsFileIOWriter(file), schema, TSFileDescriptor.getInstance().getConfig());
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   /**
@@ -115,6 +119,7 @@ public class TsFileWriter {
    */
   public TsFileWriter(File file, TSFileConfig conf) throws IOException {
     this(new TsFileIOWriter(file), new FileSchema(), conf);
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   /**
@@ -126,6 +131,7 @@ public class TsFileWriter {
    */
   public TsFileWriter(File file, FileSchema schema, TSFileConfig conf) throws IOException {
     this(new TsFileIOWriter(file), schema, conf);
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   /**
@@ -151,6 +157,7 @@ public class TsFileWriter {
           "TsFile's page size {} is greater than chunk group size {}, please enlarge the chunk group"
               + " size or decrease page size. ", pageSize, chunkGroupSizeThreshold);
     }
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   /**
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkGroupWriterImpl.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkGroupWriterImpl.java
index 8f50079..71d2928 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkGroupWriterImpl.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/chunk/ChunkGroupWriterImpl.java
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Map;
 import org.apache.iotdb.tsfile.exception.write.NoMeasurementException;
 import org.apache.iotdb.tsfile.exception.write.WriteProcessException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.footer.ChunkGroupFooter;
 import org.apache.iotdb.tsfile.write.record.datapoint.DataPoint;
 import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
@@ -47,6 +48,7 @@ public class ChunkGroupWriterImpl implements IChunkGroupWriter {
 
   public ChunkGroupWriterImpl(String deviceId) {
     this.deviceId = deviceId;
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   @Override
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/FileSchema.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/FileSchema.java
index 03e05fd..4edde4e 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/FileSchema.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/FileSchema.java
@@ -23,6 +23,7 @@ import java.util.Map;
 
 import com.alibaba.fastjson.JSONObject;
 import org.apache.iotdb.tsfile.exception.write.InvalidJsonSchemaException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 
 /**
@@ -45,6 +46,7 @@ public class FileSchema {
    */
   public FileSchema() {
     this.measurementSchema = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   /**
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/JsonConverter.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/JsonConverter.java
index 1156e4a..b9e6af4 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/JsonConverter.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/JsonConverter.java
@@ -27,6 +27,7 @@ import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
 import org.apache.iotdb.tsfile.common.constant.JsonFormatConstant;
 import org.apache.iotdb.tsfile.encoding.encoder.TSEncodingBuilder;
 import org.apache.iotdb.tsfile.exception.write.InvalidJsonSchemaException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -85,6 +86,7 @@ public class JsonConverter {
       JSONObject jsonSchema)
       throws InvalidJsonSchemaException {
     Map<String, MeasurementSchema> result = new HashMap<>();
+    HashMapInstrumentor.incCount(JsonConverter.class);
     if (!jsonSchema.containsKey(JsonFormatConstant.JSON_SCHEMA)) {
       throw new InvalidJsonSchemaException("missing fields:" + JsonFormatConstant.JSON_SCHEMA);
     }
@@ -135,6 +137,7 @@ public class JsonConverter {
         : CompressionType.valueOf(TSFileConfig.compressor);
     // all information of one series
     Map<String, String> props = new HashMap<>();
+    HashMapInstrumentor.incCount(JsonConverter.class);
     for (Object key : measurementObj.keySet()) {
       if (key.equals(JsonFormatConstant.MEASUREMENT_ENCODING) || key
           .equals(JsonFormatConstant.COMPRESS_TYPE)
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/MeasurementSchema.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/MeasurementSchema.java
index 9ae7c83..34ada31 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/MeasurementSchema.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/schema/MeasurementSchema.java
@@ -33,6 +33,7 @@ import org.apache.iotdb.tsfile.compress.ICompressor;
 import org.apache.iotdb.tsfile.encoding.encoder.Encoder;
 import org.apache.iotdb.tsfile.encoding.encoder.TSEncodingBuilder;
 import org.apache.iotdb.tsfile.exception.write.UnSupportedDataTypeException;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
 import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
@@ -60,6 +61,7 @@ public class MeasurementSchema implements Comparable<MeasurementSchema>, Seriali
   private Map<String, String> props = new HashMap<>();
 
   public MeasurementSchema() {
+    HashMapInstrumentor.incCount(this.getClass());
   }
 
   /**
@@ -108,6 +110,7 @@ public class MeasurementSchema implements Comparable<MeasurementSchema>, Seriali
     int size = ReadWriteIOUtils.readInt(inputStream);
     if (size > 0) {
       measurementSchema.props = new HashMap<>();
+      HashMapInstrumentor.incCount(MeasurementSchema.class);
       String key;
       String value;
       for (int i = 0; i < size; i++) {
@@ -137,6 +140,7 @@ public class MeasurementSchema implements Comparable<MeasurementSchema>, Seriali
     int size = ReadWriteIOUtils.readInt(buffer);
     if (size > 0) {
       measurementSchema.props = new HashMap<>();
+      HashMapInstrumentor.incCount(MeasurementSchema.class);
       String key;
       String value;
       for (int i = 0; i < size; i++) {
diff --git a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
index 5d0a2a7..e04178e 100644
--- a/tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
+++ b/tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/TsFileIOWriter.java
@@ -29,6 +29,7 @@ import java.util.Map;
 import java.util.TreeMap;
 import org.apache.iotdb.tsfile.common.conf.TSFileConfig;
 import org.apache.iotdb.tsfile.common.constant.StatisticConstant;
+import org.apache.iotdb.tsfile.expr.HashMapInstrumentor;
 import org.apache.iotdb.tsfile.file.MetaMarker;
 import org.apache.iotdb.tsfile.file.footer.ChunkGroupFooter;
 import org.apache.iotdb.tsfile.file.header.ChunkHeader;
@@ -160,6 +161,7 @@ public class TsFileIOWriter {
     LOG.debug("finish series chunk:{} header, file position {}", header, out.getPosition());
 
     Map<String, ByteBuffer> statisticsMap = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
     // TODO add your statistics
     statisticsMap.put(StatisticConstant.MAX_VALUE, ByteBuffer.wrap(statistics.getMaxBytes()));
     statisticsMap.put(StatisticConstant.MIN_VALUE, ByteBuffer.wrap(statistics.getMinBytes()));
@@ -253,6 +255,7 @@ public class TsFileIOWriter {
       List<ChunkGroupMetaData> chunkGroupMetaDataList) throws IOException {
 
     Map<String, TsDeviceMetadataIndex> tsDeviceMetadataIndexMap = new HashMap<>();
+    HashMapInstrumentor.incCount(this.getClass());
 
     long offset; /* offset for the flushing TsDeviceMetadata */