jixuan1989 commented on a change in pull request #1725: URL: https://github.com/apache/incubator-iotdb/pull/1725#discussion_r493229430
########## File path: server/src/main/java/org/apache/iotdb/db/engine/memtable/AbstractMemTable.java ########## @@ -30,6 +30,7 @@ import org.apache.iotdb.db.engine.querycontext.ReadOnlyMemChunk; import org.apache.iotdb.db.exception.WriteProcessException; import org.apache.iotdb.db.exception.query.QueryProcessException; +import org.apache.iotdb.db.monitor.StatMonitor; Review comment: remove ########## File path: server/src/main/java/org/apache/iotdb/db/engine/flush/FlushManager.java ########## @@ -93,6 +95,10 @@ public void runMayThrow() { tsFileProcessor.getTsFileResource().getTsFile().getAbsolutePath()); } registerTsFileProcessor(tsFileProcessor); + // update stat monitor cache to system during each flush() + if (IoTDBDescriptor.getInstance().getConfig().isEnableStatMonitor()) { + StatMonitor.getInstance().cacheStatValue(); Review comment: It is better to just flush the flushed SG. ########## File path: server/src/main/java/org/apache/iotdb/db/engine/StorageEngine.java ########## @@ -348,6 +352,9 @@ public void insert(InsertRowPlan insertRowPlan) throws StorageEngineException { // TODO monitor: update statistics try { storageGroupProcessor.insert(insertRowPlan); + if (config.isEnableStatMonitor()) { Review comment: have you tested the performance? I think maybe "each tsfileProcessor records the results, and then reports to the SG processor (and then reports the the Storage Engine if needed)" can reach a better performance. The sacrifice is we can not get a real time stats. A solution is add an JMX interface to update the value immediately, (then the tsfileProcessors report the data immediately) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org