Skip to content

Commit

Permalink
DRILL-5172: Display elapsed time for queries in the UI
Browse files Browse the repository at this point in the history
Formatted to remove and add spacing.
  • Loading branch information
Kunal Khatua committed Jan 12, 2017
1 parent a92f126 commit ee360f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class ProfileResources {
* @return Human-Readable Elapsed Time
*/
public static String getPrettyDuration(long startTimeMillis, long endTimeMillis) {
long durationInMillis = ( startTimeMillis > endTimeMillis ? System.currentTimeMillis() : endTimeMillis ) - startTimeMillis;
long durationInMillis = (startTimeMillis > endTimeMillis ? System.currentTimeMillis() : endTimeMillis) - startTimeMillis;
long hours = TimeUnit.MILLISECONDS.toHours(durationInMillis);
long minutes = TimeUnit.MILLISECONDS.toMinutes(durationInMillis) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(durationInMillis));
long seconds = TimeUnit.MILLISECONDS.toSeconds(durationInMillis) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(durationInMillis));
Expand Down Expand Up @@ -137,7 +137,7 @@ public long getEndTime() {
}

public String getDuration() {
return getPrettyDuration(startTime,endTime);
return getPrettyDuration(startTime, endTime);
}

public String getState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public QueryProfile getProfile() {
}

public String getProfileDuration() {
return ProfileResources.getPrettyDuration(profile.getStart(),profile.getEnd());
return ProfileResources.getPrettyDuration(profile.getStart(), profile.getEnd());
}

public String getQueryId() {
Expand Down

0 comments on commit ee360f6

Please sign in to comment.