You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/03/19 08:02:53 UTC

[GitHub] [iotdb] liu-hai opened a new pull request #2874: [IOTDB-#2679] add "Clean the tracing log" of creating PR

liu-hai opened a new pull request #2874:
URL: https://github.com/apache/iotdb/pull/2874


   …iotdb/issues/2679])
   
   ## Description
   Clean the tracing log #2679
   https://github.com/apache/iotdb/issues/2679
   ### Content1 ...
   Add a cli command : TRACING ClEAR ALL
   TRACING ClEAR ALL can be used to clear the Tracing log
   
   


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] Alima777 commented on a change in pull request #2874: [IOTDB-#2679] add "Clean the tracing log" of creating PR

Posted by GitBox <gi...@apache.org>.
Alima777 commented on a change in pull request #2874:
URL: https://github.com/apache/iotdb/pull/2874#discussion_r597534390



##########
File path: server/src/main/java/org/apache/iotdb/db/qp/logical/sys/TracingOperator.java
##########
@@ -24,13 +24,25 @@
 
   private boolean isTracingOn;
 
+  private Integer tracingType;

Review comment:
       Use primitive data type `int` instead of `Integer`

##########
File path: server/src/main/java/org/apache/iotdb/db/qp/executor/PlanExecutor.java
##########
@@ -410,7 +411,24 @@ private void operateKillQuery(KillQueryPlan killQueryPlan) throws QueryIdNotExsi
   }
 
   private void operateTracing(TracingPlan plan) {
-    IoTDBDescriptor.getInstance().getConfig().setEnablePerformanceTracing(plan.isTracingOn());
+    if (plan.tracingType() != null && plan.tracingType() > 0) {
+      tracingClearAll();
+    } else {
+      IoTDBDescriptor.getInstance().getConfig().setEnablePerformanceTracing(plan.isTracingOn());
+    }
+  }
+
+  private void tracingClearAll() {
+    Boolean isTracingOn = IoTDBDescriptor.getInstance().getConfig().isEnablePerformanceTracing();

Review comment:
       boolean instead of `Boolean`




-- 
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:
users@infra.apache.org



[GitHub] [iotdb] liu-hai closed pull request #2874: [IOTDB-2679] add "Clean the tracing log" of creating PR(added UT and IT)

Posted by GitBox <gi...@apache.org>.
liu-hai closed pull request #2874:
URL: https://github.com/apache/iotdb/pull/2874


   


-- 
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:
users@infra.apache.org



[GitHub] [iotdb] liu-hai commented on a change in pull request #2874: [IOTDB-#2679] add "Clean the tracing log" of creating PR

Posted by GitBox <gi...@apache.org>.
liu-hai commented on a change in pull request #2874:
URL: https://github.com/apache/iotdb/pull/2874#discussion_r600077928



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4
##########
@@ -84,6 +84,7 @@ statement
     | KILL QUERY INT? #killQuery
     | TRACING ON #tracingOn
     | TRACING OFF #tracingOff
+    | TRACING CLEAR ALL #tracingClearAll

Review comment:
       Added UT and IT tests




-- 
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:
users@infra.apache.org



[GitHub] [iotdb] wangchao316 commented on a change in pull request #2874: [IOTDB-#2679] add "Clean the tracing log" of creating PR

Posted by GitBox <gi...@apache.org>.
wangchao316 commented on a change in pull request #2874:
URL: https://github.com/apache/iotdb/pull/2874#discussion_r598085942



##########
File path: antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/SqlBase.g4
##########
@@ -84,6 +84,7 @@ statement
     | KILL QUERY INT? #killQuery
     | TRACING ON #tracingOn
     | TRACING OFF #tracingOff
+    | TRACING CLEAR ALL #tracingClearAll

Review comment:
       hi , thanks for your contribution.
   you need add some UT or IT for your function.
   Thanks

##########
File path: server/src/main/java/org/apache/iotdb/db/conf/IoTDBConfig.java
##########
@@ -1309,6 +1311,21 @@ public boolean isEnablePerformanceTracing() {
 
   public void setEnablePerformanceTracing(boolean enablePerformanceTracing) {
     this.enablePerformanceTracing = enablePerformanceTracing;
+    if (!enablePerformanceTracing) {
+      try {
+        TracingManager.getInstance().close();

Review comment:
       generate a class only do a thing.  IoTDBConfig only get or set config.. if you need deal other logic, you can do it in other class




-- 
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:
users@infra.apache.org



[GitHub] [iotdb] liu-hai closed pull request #2874: [IOTDB-2679] add "Clean the tracing log" of creating PR(added UT and IT)

Posted by GitBox <gi...@apache.org>.
liu-hai closed pull request #2874:
URL: https://github.com/apache/iotdb/pull/2874


   


-- 
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:
users@infra.apache.org