vogievetsky commented on a change in pull request #7421: Add time taken by last 
query in SQL view
URL: https://github.com/apache/incubator-druid/pull/7421#discussion_r273277382
 
 

 ##########
 File path: web-console/src/views/sql-view.tsx
 ##########
 @@ -62,34 +64,44 @@ export class SqlView extends React.Component<SqlViewProps, 
SqlViewState> {
       explainDialogOpen: false,
       loadingExplain: false,
       explainResult: null,
-      explainError: null
+      explainError: null,
+      queryElapsed: null
     };
   }
 
   componentDidMount(): void {
     this.sqlQueryManager = new QueryManager({
       processQuery: async (query: string) => {
+        const startTime = new Date();
         if (query.trim().startsWith('{')) {
           // Secret way to issue a native JSON "rune" query
           const runeQuery = Hjson.parse(query);
-          return decodeRune(runeQuery, await queryDruidRune(runeQuery));
-
+          const result = await queryDruidRune(runeQuery);
+          const queryElapsed =  new Date().valueOf() - startTime.valueOf();
+          return {
+            queryResult: decodeRune(runeQuery, result),
+            queryElapsed
+          };
         } else {
           const result = await queryDruidSql({
             query,
             resultFormat: "array",
             header: true
           });
-
+          const queryElapsed =  new Date().valueOf() - startTime.valueOf();
 
 Review comment:
   Can this just be inline?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to