You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by kkhatua <gi...@git.apache.org> on 2017/09/26 20:58:07 UTC

[GitHub] drill pull request #963: DRILL-5259: Allow listing a user-defined number of ...

GitHub user kkhatua opened a pull request:

    https://github.com/apache/drill/pull/963

    DRILL-5259: Allow listing a user-defined number of profiles

    Added an additional field in the UI allowing a user to specify the max number of profiles to display

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kkhatua/drill DRILL-5259

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/963.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #963
    
----
commit f4a538361fe2494627d5425de345f525471c245c
Author: Kunal Khatua <kk...@maprtech.com>
Date:   2017-09-26T20:55:40Z

    DRILL-5259: Allow listing a user-defined number of profiles 
    
    Added an additional field in the UI allowing a user to specify the max number of profiles to display

----


---

[GitHub] drill issue #963: DRILL-5259: Allow listing a user-defined number of profile...

Posted by kkhatua <gi...@git.apache.org>.
Github user kkhatua commented on the issue:

    https://github.com/apache/drill/pull/963
  
    @paul-rogers Opened a new PR as I accidentally closed #953 . This is ready for review.


---

[GitHub] drill pull request #963: DRILL-5259: Allow listing a user-defined number of ...

Posted by paul-rogers <gi...@git.apache.org>.
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/963#discussion_r141191837
  
    --- Diff: exec/java-exec/src/main/resources/rest/profile/list.ftl ---
    @@ -37,7 +37,15 @@
           <strong>No running queries.</strong>
         </div>
       </#if>
    -  <h3>Completed Queries</h3>
    +  <table width="100%">
    +    <tr>
    +      <td><h3>Completed Queries</h3></td>
    +      <td align="right">
    +        <form action="/profiles" method="get"><span title="Max number of profiles to list">Show </span>
    +        <input id="fetchMax" type="text" size="7" name="max" value="${model.getFinishedQueries()?size}">
    --- End diff --
    
    Better! But, the number to show is the *target* number of profiles, not the *actual* number. If we show the actual number, then we get this:
    
    * Show profiles with the target of 100.
    * We actually have 10 profiles, so that is displayed in the "max" control.
    * Two more profiles come in, now we have 12.
    * Hit the "Go" button. Only 10 profiles appear because that was the prior count.
    * Must manually type a larger number to see more.
    
    What we want:
    
    * Show profiles with the target of 100.
    * We actually have 10 profiles, but the target is 100, so 100 is displayed in the "max" control.
    * Two more profiles come in, now we have 12.
    * Hit the "Go" button. All 12 profiles appear.
    
    To make this work:
    
    * Add to the model the *target* number: either the default of 100 or the number received via the max parameter.
    * Display that model number in the "max" control.
    



---

[GitHub] drill issue #963: DRILL-5259: Allow listing a user-defined number of profile...

Posted by kkhatua <gi...@git.apache.org>.
Github user kkhatua commented on the issue:

    https://github.com/apache/drill/pull/963
  
    @paul-rogers please bless this
    - Checks in place for non-numeric or out-of-range numeric inputs.
    - Auto fill if the max requested range exceeds the actual number of profiles available. User would not need to re-enter a value, just hit `Go`


---

[GitHub] drill pull request #963: DRILL-5259: Allow listing a user-defined number of ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/drill/pull/963


---

[GitHub] drill pull request #963: DRILL-5259: Allow listing a user-defined number of ...

Posted by paul-rogers <gi...@git.apache.org>.
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/963#discussion_r141192014
  
    --- Diff: exec/java-exec/src/main/resources/rest/profile/list.ftl ---
    @@ -37,7 +37,15 @@
           <strong>No running queries.</strong>
         </div>
       </#if>
    -  <h3>Completed Queries</h3>
    +  <table width="100%">
    +    <tr>
    +      <td><h3>Completed Queries</h3></td>
    +      <td align="right">
    +        <form action="/profiles" method="get"><span title="Max number of profiles to list">Show </span>
    +        <input id="fetchMax" type="text" size="7" name="max" value="${model.getFinishedQueries()?size}">
    +        <input type="submit" value="Go">
    +      </form></td>
    +    </tr></table>
    --- End diff --
    
    BTW: we should validate the max parameter in the Java code. Force max into the range: 1 ... 500 (say).
    
    That is, don't allow -1, 0 or 1000000 profiles.


---

[GitHub] drill pull request #963: DRILL-5259: Allow listing a user-defined number of ...

Posted by kkhatua <gi...@git.apache.org>.
Github user kkhatua commented on a diff in the pull request:

    https://github.com/apache/drill/pull/963#discussion_r142240395
  
    --- Diff: exec/java-exec/src/main/resources/rest/profile/list.ftl ---
    @@ -37,7 +37,42 @@
           <strong>No running queries.</strong>
         </div>
       </#if>
    -  <h3>Completed Queries</h3>
    +  <table width="100%">
    +    <script type="text/javascript" language="javascript">
    +    //Validate that the fetch number is valid
    +    function checkMaxFetch() {
    +      var maxFetch = document.forms["profileFetch"]["max"].value;
    +      console.log("maxFetch: " + maxFetch);
    +      if (isNaN(maxFetch) || (maxFetch < 1) || (maxFetch > 100000) ) {
    +        alert("Invalid Entry: " + maxFetch + "\n" +
    +               Please enter a valid number of profiles to fetch (1 to 100000) ");
    +        return false;
    +      }
    +      return true;
    +    }
    +    </script>
    +    <tr>
    +      <td><h3>Completed Queries</h3></td>
    +      <td align="right">
    +        <form name="profileFetch" action="/profiles" onsubmit="return checkMaxFetch();" method="get"><span title="Max number of profiles to list">Showing <b>${model.getFinishedQueries()?size}</b> profiles. Max: </span>
    +        <input id="fetchMax" type="text" size="7" name="max" value="">
    --- End diff --
    
    Done. 
    1. The keyword is now 'Refresh'.
    2. The default fetch is populated into the textbox. Any subsequent changes are retained, so the user does not have to re-enter a value to trigger a reload. Only click on Refresh. 



---

[GitHub] drill issue #963: DRILL-5259: Allow listing a user-defined number of profile...

Posted by paul-rogers <gi...@git.apache.org>.
Github user paul-rogers commented on the issue:

    https://github.com/apache/drill/pull/963
  
    Thanks for the improvements.
    LGTM
    +1


---

[GitHub] drill pull request #963: DRILL-5259: Allow listing a user-defined number of ...

Posted by paul-rogers <gi...@git.apache.org>.
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/963#discussion_r142018753
  
    --- Diff: exec/java-exec/src/main/resources/rest/profile/list.ftl ---
    @@ -37,7 +37,42 @@
           <strong>No running queries.</strong>
         </div>
       </#if>
    -  <h3>Completed Queries</h3>
    +  <table width="100%">
    +    <script type="text/javascript" language="javascript">
    +    //Validate that the fetch number is valid
    +    function checkMaxFetch() {
    +      var maxFetch = document.forms["profileFetch"]["max"].value;
    +      console.log("maxFetch: " + maxFetch);
    +      if (isNaN(maxFetch) || (maxFetch < 1) || (maxFetch > 100000) ) {
    +        alert("Invalid Entry: " + maxFetch + "\n" +
    +               Please enter a valid number of profiles to fetch (1 to 100000) ");
    +        return false;
    +      }
    +      return true;
    +    }
    +    </script>
    +    <tr>
    +      <td><h3>Completed Queries</h3></td>
    +      <td align="right">
    +        <form name="profileFetch" action="/profiles" onsubmit="return checkMaxFetch();" method="get"><span title="Max number of profiles to list">Showing <b>${model.getFinishedQueries()?size}</b> profiles. Max: </span>
    +        <input id="fetchMax" type="text" size="7" name="max" value="">
    --- End diff --
    
    Here we want to show the current fetch max setting. This is either:
    
    * The default number, if the user has nor provided a value.
    * The last submitted value.
    
    Let's say the default is 100. Then we'd want to first see:
    
    Max: [  100] [Fetch]
    
    The user decides to view just 20 by changing the number and clicking Fetch. Now we'd want to see:
    
    Max: [   20] [Fetch]
    
    Also, "Fetch" is a bit awkward. Maybe "Refresh" would be better.


---