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
+ * @return Human-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.
---
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.
---