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()`.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to