Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/738#discussion_r99439263
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileResources.java
---
@@ -77,12 +77,14 @@
*/
public static String getPrettyDuration(long startTimeMillis, long
endTimeMillis) {
long durationInMillis = (startTimeMillis > endTimeMillis ?
System.currentTimeMillis() : endTimeMillis) - startTimeMillis;
- long hours = TimeUnit.MILLISECONDS.toHours(durationInMillis);
+ long days = TimeUnit.MILLISECONDS.toDays(durationInMillis);
--- End diff --
Good point. Maybe have a single utility class with two methods: one for the
compact form, one for the verbose form. Callers can choose the format best for
a particular presentation.
Note that, in both cases, we need to tear apart the duration into various
units. This suggests not a static class, but an actual "real" class:
```
DurationFormat df = new DurationFormat( durationMs );
System.out.println( df.compact() );
System.out.println( df.verbose() );
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---