[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-16 Thread Khurram Faraaz (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15823834#comment-15823834
 ] 

Khurram Faraaz commented on DRILL-5172:
---

Verified manually from profiles tab on the Web UI, executed few TPC-DS queries 
and verified that time taken is displayed under Duration for completed queries. 
Drill 1.10.0 commit id : 8a4d7a99

> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
>  Labels: ready-to-commit
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-15 Thread Arina Ielchiieva (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15823144#comment-15823144
 ] 

Arina Ielchiieva commented on DRILL-5172:
-

Merged into master with commit id 8a4d7a9940499a8c972362ab1133d75f211ec786

> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
>  Labels: ready-to-commit
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-13 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15822679#comment-15822679
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user asfgit closed the pull request at:

https://github.com/apache/drill/pull/721


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
>  Labels: ready-to-commit
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15820708#comment-15820708
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/721#discussion_r95764299
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -105,6 +128,17 @@ public String getTime() {
   return format.format(time);
 }
 
+public long getStartTime() {
+  return startTime;
+}
+
+public long getEndTime() {
+  return endTime;
+}
+
+public String getDuration() {
+  return getPrettyDuration(startTime,endTime);
--- End diff --

Please add space between parameters -> `startTime, endTime`


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15820707#comment-15820707
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/721#discussion_r95764142
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileWrapper.java
 ---
@@ -114,6 +114,10 @@ public QueryProfile getProfile() {
 return profile;
   }
 
+  public String getProfileDuration() {
+return 
ProfileResources.getPrettyDuration(profile.getStart(),profile.getEnd());
--- End diff --

Please add space between parameters -> `profile.getStart(), 
profile.getEnd()`


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15820709#comment-15820709
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/721#discussion_r95764706
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -68,20 +68,43 @@
   @Inject DrillUserPrincipal principal;
   @Inject SecurityContext sc;
 
+  /**
+   * Returns elapsed time a human-readable format. If end time is less 
than the start time, current epoch time is assumed as the end time.
+   * e.g. getPrettyDuration(1468368841695,1468394096016) = '7 hr 00 min 
54.321 sec'
+   * @param startTimeMillis Start Time in milliseconds
+   * @param endTimeMillis   End Time in milliseconds
+   * @returnHuman-Readable Elapsed Time
+   */
+  public static String getPrettyDuration(long startTimeMillis, long 
endTimeMillis) {
+long durationInMillis = ( startTimeMillis > endTimeMillis ? 
System.currentTimeMillis() : endTimeMillis ) - startTimeMillis;
--- End diff --

Please remove space after -> `(startTimeMillis` and before -> 
`endTimeMillis)` parenthesis.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15819712#comment-15819712
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on the issue:

https://github.com/apache/drill/pull/721
  
@arina-ielchiieva , @paul-rogers , @sudheeshkatkam 
Closed the previous PR due to mixup with squashing and rebasing. Please 
review this PR. 


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15819706#comment-15819706
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

GitHub user kkhatua opened a pull request:

https://github.com/apache/drill/pull/721

DRILL-5172: Display elapsed time for queries in the UI

Displays the elapsed time for running queries and the total duration of 
completed/failed/cancelled queries in the list of query profiles displayed, and 
within a query's profile page as well.
The query runtime is  displayed in `[hr] [min] sec`.
e.g. A duration of `25,254,321ms` is displayed  `7 hr 00 min 54.321 sec` 


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/kkhatua/drill DRILL-5172

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/721.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #721


commit a92f12668dbcd881468b2b128373866df8d115ae
Author: Kunal Khatua 
Date:   2017-01-12T00:45:15Z

DRILL-5172: Display elapsed time for queries in the UI

Displays the elapsed time for running queries and the total duration of 
completed/failed/cancelled queries in the list of query profiles displayed, and 
within a query's profile page as well.
The query runtime is  displayed in '[hr] [min] sec'.
e.g. A duration of 25,254,321ms is displayed  7 hr 00 min 54.321 sec




> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15819660#comment-15819660
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on the issue:

https://github.com/apache/drill/pull/719
  
Closing the pull request. Attempted to rebase and squash, but got 
interleaved commits with master. Will send out a new pull request. 


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15819659#comment-15819659
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua closed the pull request at:

https://github.com/apache/drill/pull/719


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15819464#comment-15819464
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95692761
  
--- Diff: exec/java-exec/src/main/resources/rest/profile/profile.ftl ---
@@ -106,6 +106,7 @@
   STATE: ${model.getProfile().getState().name()}
   FOREMAN: ${model.getProfile().getForeman().getAddress()}
   TOTAL FRAGMENTS: ${model.getProfile().getTotalFragments()}
+  DURATION: ${model.getProfileDuration()}
--- End diff --

The end time for a query is not set until the very end of the query, so the 
default value in 0L. For the `/profiles ` template, the elapsed time is 
computed using the current time in millis for running queries. Hence it shows 
correctly here. As per your suggestion, fixed it now by changing the signature 
to take the start and end times as arguments.  


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15818240#comment-15818240
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95569784
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -68,20 +68,35 @@
   @Inject DrillUserPrincipal principal;
   @Inject SecurityContext sc;
 
+  public static String getPrettyDuration(long durationInMillis) {
+long hours = TimeUnit.MILLISECONDS.toHours(durationInMillis);
--- End diff --

Please add description with output example.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15818237#comment-15818237
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95570474
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -105,6 +120,17 @@ public String getTime() {
   return format.format(time);
 }
 
+public long getStartTime() {
+  return startTime;
+}
+
+public long getEndTime() {
+  return endTime;
+}
+
+public String getDuration() {
+  return getPrettyDuration(endTime - startTime);
+}
--- End diff --

May be we can factor out calculation? Please see comment above.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15818238#comment-15818238
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95571159
  
--- Diff: exec/java-exec/src/main/resources/rest/profile/profile.ftl ---
@@ -106,6 +106,7 @@
   STATE: ${model.getProfile().getState().name()}
   FOREMAN: ${model.getProfile().getForeman().getAddress()}
   TOTAL FRAGMENTS: ${model.getProfile().getTotalFragments()}
+  DURATION: ${model.getProfileDuration()}
--- End diff --

For running queries, I see incorrect duration calculation. On `/profiles` 
elapsed time is shown correctly but when you step into running profile, 
duration is shown incorrectly.

![image](https://cloud.githubusercontent.com/assets/15086720/21849179/259dc0ae-d80d-11e6-990d-cbb9e2d072ad.png)

![image](https://cloud.githubusercontent.com/assets/15086720/21849198/3c26d9f0-d80d-11e6-873d-8bd439cc4351.png)




> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15818236#comment-15818236
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95570493
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileWrapper.java
 ---
@@ -114,6 +114,10 @@ public QueryProfile getProfile() {
 return profile;
   }
 
+  public String getProfileDuration() {
+return 
ProfileResources.getPrettyDuration(profile.getEnd()-profile.getStart());
+  }
--- End diff --

May be we can factor out calculation? Please see comment above.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15818239#comment-15818239
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95570379
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -68,20 +68,35 @@
   @Inject DrillUserPrincipal principal;
   @Inject SecurityContext sc;
 
+  public static String getPrettyDuration(long durationInMillis) {
+long hours = TimeUnit.MILLISECONDS.toHours(durationInMillis);
--- End diff --

May be this utility method can accept two parameters: `long start, long 
end`, so you won't have to repeat the following logic 
`profile.getEnd()-profile.getStart()` or `endTime - startTime`?


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15816427#comment-15816427
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95475935
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -105,6 +109,25 @@ public String getTime() {
   return format.format(time);
 }
 
+public long getStartTime() {
+  return startTime;
+}
+
+public long getEndTime() {
+  return endTime;
+}
+
+public String getDuration() {
--- End diff --

Done. This is a much simpler and cleaner solution. Thank you, 
@arina-ielchiieva !


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15816352#comment-15816352
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95470389
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -105,6 +109,25 @@ public String getTime() {
   return format.format(time);
 }
 
+public long getStartTime() {
+  return startTime;
+}
+
+public long getEndTime() {
+  return endTime;
+}
+
+public String getDuration() {
--- End diff --

That could be one way to work around it. It would be good to have the 
human-readable formatting done through only one static method. I'm still trying 
to familiarize myself with the way these classes and the freemarker templates 
interact, so let me see if I can do with a wrapper. :) 


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15816338#comment-15816338
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95469066
  
--- Diff: 
protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java ---
@@ -13595,6 +13597,17 @@ public long getEnd() {
   return end_;
 }
 
+public String getDuration() {
--- End diff --

The ProfileInfo class is actually where the change was made to retrieve the 
value from the model. We don't create any duration field, as it is computed 
based on the other 2 fields (start,end) and simply provide a getter for that. 
However, the ProfileInfo class is used only by the profiles listing freemarker 
template (list.ftl). 
For the individual query profile's template (profile.ftl), the model from 
which we retrieve the duration value is auto-generated by the protobuf, making 
this a lot more complicated to implement. Hence, we took the JavaScript 
approach. 
I'll probably refine it to strictly follow the MVC model when I'm 
attempting a fix for DRILL-5190 
https://issues.apache.org/jira/browse/DRILL-5190  [Display planning time for a 
query in its profile page ] , since that would require me to modify the 
protobuf.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15815902#comment-15815902
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95436174
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -105,6 +109,25 @@ public String getTime() {
   return format.format(time);
 }
 
+public long getStartTime() {
+  return startTime;
+}
+
+public long getEndTime() {
+  return endTime;
+}
+
+public String getDuration() {
--- End diff --

How about we create wrapper class around `QueryProfile` (ex: 
`QueryProfileWrapper`) which will contain `getDuration` method along with 
needed `QueryProfile` methods. Logic for converting two long values (start and 
end) into human-readable format will be factored out into static method in 
`ProfileResources` (ex: `convertDurationIntoString(long start, long end)`). 
`QueryProfileWrapper` and `ProfileResources` will call this utility method from 
their `getDuration` methods.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15815854#comment-15815854
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95432224
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -105,6 +109,25 @@ public String getTime() {
   return format.format(time);
 }
 
+public long getStartTime() {
+  return startTime;
+}
+
+public long getEndTime() {
+  return endTime;
+}
+
+public String getDuration() {
--- End diff --

The logic in this Java class provides the duration for the listing 
generated in the profile listing Freemarker file (list.ftl). For the actual 
query profile page, this gets trickier, since the freemarker template refers to 
methods from the auto-generated UserBitShared class in the protocol package. 


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15815539#comment-15815539
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95411447
  
--- Diff: 
protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java ---
@@ -13595,6 +13597,17 @@ public long getEnd() {
   return end_;
 }
 
+public String getDuration() {
--- End diff --

Actually, the right place to do this work is in the Java code that creates 
the "model" that we pass to Freemarker. (Yeah, it is kind of complicated.)

Freemarker uses the classic MVC model. The template is the view. Java 
builds the model. (Let's ignore the controller for now.)

For an example, look in `ProfileResources.java`, which is in this PR. Look 
at the `ProfileInfo` class. Here we gather up the bits of information we want 
to display on the web page. Any calcs needed to prepare the data are done here. 
Then, Freemarker simply pulls out the pre-created data using the getter methods.

So, the `ProfileInfo` class could be extended to have, say, the raw 
duration in ms along with methods to return the computed values: 
`getDisplayDuration()` and `getDurationUnits()`.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15814703#comment-15814703
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user arina-ielchiieva commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95344665
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -105,6 +109,25 @@ public String getTime() {
   return format.format(time);
 }
 
+public long getStartTime() {
+  return startTime;
+}
+
+public long getEndTime() {
+  return endTime;
+}
+
+public String getDuration() {
--- End diff --

It seems we have similar logic here and in freemarker template for 
duration. May it can be removed in one of them?


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15814485#comment-15814485
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95327930
  
--- Diff: 
protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java ---
@@ -13595,6 +13597,17 @@ public long getEnd() {
   return end_;
 }
 
+public String getDuration() {
--- End diff --

Removed the logic. We'll do this within the Webpage using Javascript. 


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15812433#comment-15812433
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95211879
  
--- Diff: 
protocol/src/main/java/org/apache/drill/exec/proto/UserBitShared.java ---
@@ -13595,6 +13597,17 @@ public long getEnd() {
   return end_;
 }
 
+public String getDuration() {
--- End diff --

This is an auto-generated file. Do not define logic in this class.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15810871#comment-15810871
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95108121
  
--- Diff: exec/java-exec/src/main/resources/rest/profile/list.ftl ---
@@ -64,6 +65,8 @@
 
   ${query.getState()}  
 
+  ${(.now?long - 
query.getStartTime()) / 1000} sec  
--- End diff --

Good point. For long running queries, reporting in a single unit actually 
makes readability much harder. Modified in the next commit. Had to modify the 
UserBitShared class, however, to add this functionality for the query profile. 
Unless there is a change to the protobuf, we should be fine. 


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-08 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15810866#comment-15810866
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user kkhatua commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r95107988
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -72,16 +72,30 @@
 public static final SimpleDateFormat format = new 
SimpleDateFormat("MM/dd/ HH:mm:ss");
 
 private String queryId;
+private long startTime;
+private long endTime;
 private Date time;
 private String location;
 private String foreman;
 private String query;
 private String state;
 private String user;
 
-public ProfileInfo(String queryId, long time, String foreman, String 
query, String state, String user) {
+public ProfileInfo(String queryId, long startTime, String foreman, 
String query, String state, String user) {
   this.queryId = queryId;
-  this.time = new Date(time);
+  this.startTime = startTime;
--- End diff --

Agreed. Collapsed into a single constructor. We'll use the current time 
directly to mark the current 'end' time. 


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15802656#comment-15802656
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r94860581
  
--- Diff: exec/java-exec/src/main/resources/rest/profile/list.ftl ---
@@ -64,6 +65,8 @@
 
   ${query.getState()}  
 
+  ${(.now?long - 
query.getStartTime()) / 1000} sec  
--- End diff --

Rounding? Should 999 ms be shown as 0 seconds or 1 second. Actually, given 
the short duration of some queries, should the time be shown down to the ms? 
That is either 1234 ms or 1.234 sec. Or, we could be fancy and show only three 
digits of precision: 1.23 seconds, 123,000 seconds. Further, do we want to 
shift units as the numbers increase: 234 ms, 23.4 seconds, 15 min 34 sec. 1 hr 
23 min.?


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15802657#comment-15802657
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r94860865
  
--- Diff: exec/java-exec/src/main/resources/rest/profile/profile.ftl ---
@@ -106,7 +106,13 @@
   STATE: ${model.getProfile().getState().name()}
   FOREMAN: ${model.getProfile().getForeman().getAddress()}
   TOTAL FRAGMENTS: ${model.getProfile().getTotalFragments()}
-
+  
+  <#if (model.getProfile().getState().name() == "RUNNING")> 
+ELAPSED: ${(.now?long - model.getProfile().getStart()) / 1000} 
+  <#else> 
+DURATION: ${(model.getProfile().getEnd() - 
model.getProfile().getStart()) / 1000} 
--- End diff --

Units?


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-05 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15802655#comment-15802655
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user paul-rogers commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r94860776
  
--- Diff: exec/java-exec/src/main/resources/rest/profile/profile.ftl ---
@@ -106,7 +106,13 @@
   STATE: ${model.getProfile().getState().name()}
   FOREMAN: ${model.getProfile().getForeman().getAddress()}
   TOTAL FRAGMENTS: ${model.getProfile().getTotalFragments()}
-
+  
+  <#if (model.getProfile().getState().name() == "RUNNING")> 
+ELAPSED: ${(.now?long - model.getProfile().getStart()) / 1000} 
--- End diff --

Rather than encoding this in the template three times, perhaps compute it 
ahead of time and store the computed result in the "model". Makes it easier to 
handle the multi-unit formatting, digits of precision, etc.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15798949#comment-15798949
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user sudheeshkatkam commented on the issue:

https://github.com/apache/drill/pull/719
  
+1, pending minor comment


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-04 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15798947#comment-15798947
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

Github user sudheeshkatkam commented on a diff in the pull request:

https://github.com/apache/drill/pull/719#discussion_r94635283
  
--- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
 ---
@@ -72,16 +72,30 @@
 public static final SimpleDateFormat format = new 
SimpleDateFormat("MM/dd/ HH:mm:ss");
 
 private String queryId;
+private long startTime;
+private long endTime;
 private Date time;
 private String location;
 private String foreman;
 private String query;
 private String state;
 private String user;
 
-public ProfileInfo(String queryId, long time, String foreman, String 
query, String state, String user) {
+public ProfileInfo(String queryId, long startTime, String foreman, 
String query, String state, String user) {
   this.queryId = queryId;
-  this.time = new Date(time);
+  this.startTime = startTime;
--- End diff --

Invoke the other ctor from here.


> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (DRILL-5172) Display elapsed time for queries in the UI

2017-01-03 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/DRILL-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15797430#comment-15797430
 ] 

ASF GitHub Bot commented on DRILL-5172:
---

GitHub user kkhatua opened a pull request:

https://github.com/apache/drill/pull/719

DRILL-5172: Display elapsed time for queries in the UI

Displays the elapsed time for running queries and the total duration of
completed/failed/cancelled queries in the list of query profiles
displayed, and within a query's profile page as well.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/kkhatua/drill master

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/drill/pull/719.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #719


commit 48ef739fffa9ba4f2b05412d7b846b48161fdedc
Author: Kunal Khatua 
Date:   2017-01-04T07:24:36Z

DRILL-5172: Display elapsed time for queries in the UI

Displays the elapsed time for running queries and the total duration of
completed/failed/cancelled queries in the list of query profiles
displayed, and within a query's profile page as well.




> Display elapsed time for queries in the UI
> --
>
> Key: DRILL-5172
> URL: https://issues.apache.org/jira/browse/DRILL-5172
> Project: Apache Drill
>  Issue Type: Improvement
>  Components: Web Server
>Affects Versions: 1.9.0
>Reporter: Kunal Khatua
>Assignee: Kunal Khatua
>Priority: Minor
> Fix For: 1.10.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Currently, the Web UI does not display the runtime for a query either in the 
> list of queries or the query profile page itself.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)