drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #719: DRILL-5172: Display elapsed time for queries in the...
Date Tue, 10 Jan 2017 17:12:50 GMT
Github user paul-rogers commented on a diff in the pull request:

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

View raw message