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

tanxinyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new f99509b4705 [Metrics] Fix the grafana panel display error caused by 
not initializing trigTime (#13496)
f99509b4705 is described below

commit f99509b470575850fcd4cff7441335a93c0fa03c
Author: 133tosakarin <[email protected]>
AuthorDate: Fri Sep 13 19:51:18 2024 +0800

    [Metrics] Fix the grafana panel display error caused by not initializing 
trigTime (#13496)
---
 .../iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java    |  8 +++-----
 .../iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java    | 11 ++++-------
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java
index 11f4ad03ad4..638ea109c9f 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v1/impl/RestApiServiceImpl.java
@@ -79,7 +79,7 @@ public class RestApiServiceImpl extends RestApiService {
   @Override
   public Response executeNonQueryStatement(SQL sql, SecurityContext 
securityContext) {
     Long queryId = null;
-    long startTime = 0;
+    long startTime = System.nanoTime();
     boolean finish = false;
     Statement statement = null;
     try {
@@ -93,7 +93,6 @@ public class RestApiServiceImpl extends RestApiService {
                     .message("This operation type is not supported"))
             .build();
       }
-      startTime = System.nanoTime();
       if (!ExecuteStatementHandler.validateStatement(statement)) {
         return Response.ok()
             .entity(
@@ -154,12 +153,11 @@ public class RestApiServiceImpl extends RestApiService {
   @Override
   public Response executeQueryStatement(SQL sql, SecurityContext 
securityContext) {
     Long queryId = null;
-    long startTime = 0;
+    long startTime = System.nanoTime();
     boolean finish = false;
     Statement statement = null;
     try {
       RequestValidationHandler.validateSQL(sql);
-      startTime = System.nanoTime();
       statement = StatementGenerator.createStatement(sql.getSql(), 
ZoneId.systemDefault());
       if (statement == null) {
         return Response.ok()
@@ -236,7 +234,7 @@ public class RestApiServiceImpl extends RestApiService {
   public Response insertTablet(
       InsertTabletRequest insertTabletRequest, SecurityContext 
securityContext) {
     Long queryId = null;
-    long startTime = 0;
+    long startTime = System.nanoTime();
     InsertTabletStatement insertTabletStatement = null;
     try {
       
RequestValidationHandler.validateInsertTabletRequest(insertTabletRequest);
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java
index 67d6ed1a033..018a9d90763 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/impl/RestApiServiceImpl.java
@@ -84,11 +84,10 @@ public class RestApiServiceImpl extends RestApiService {
   public Response executeNonQueryStatement(SQL sql, SecurityContext 
securityContext) {
     Long queryId = null;
     Statement statement = null;
-    long startTime = 0;
+    long startTime = System.nanoTime();
     boolean finish = false;
     try {
       RequestValidationHandler.validateSQL(sql);
-      startTime = System.nanoTime();
       statement = StatementGenerator.createStatement(sql.getSql(), 
ZoneId.systemDefault());
       if (statement == null) {
         return Response.ok()
@@ -149,11 +148,10 @@ public class RestApiServiceImpl extends RestApiService {
   public Response executeQueryStatement(SQL sql, SecurityContext 
securityContext) {
     Long queryId = null;
     Statement statement = null;
-    long startTime = 0;
+    long startTime = System.nanoTime();
     boolean finish = false;
     try {
       RequestValidationHandler.validateSQL(sql);
-      startTime = System.nanoTime();
       statement = StatementGenerator.createStatement(sql.getSql(), 
ZoneId.systemDefault());
 
       if (statement == null) {
@@ -233,10 +231,9 @@ public class RestApiServiceImpl extends RestApiService {
   public Response insertRecords(
       InsertRecordsRequest insertRecordsRequest, SecurityContext 
securityContext) {
     Long queryId = null;
-    long startTime = 0;
+    long startTime = System.nanoTime();
     InsertRowsStatement insertRowsStatement = null;
     try {
-      startTime = System.nanoTime();
       
RequestValidationHandler.validateInsertRecordsRequest(insertRecordsRequest);
 
       insertRowsStatement =
@@ -278,7 +275,7 @@ public class RestApiServiceImpl extends RestApiService {
   public Response insertTablet(
       InsertTabletRequest insertTabletRequest, SecurityContext 
securityContext) {
     Long queryId = null;
-    long startTime = 0;
+    long startTime = System.nanoTime();
     InsertTabletStatement insertTabletStatement = null;
     try {
       
RequestValidationHandler.validateInsertTabletRequest(insertTabletRequest);

Reply via email to