You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by robertkowalski <gi...@git.apache.org> on 2014/04/19 14:36:43 UTC

[GitHub] couchdb pull request: Group log messages by date - COUCHDB-2136

GitHub user robertkowalski opened a pull request:

    https://github.com/apache/couchdb/pull/214

    Group log messages by date - COUCHDB-2136

    Introduce a heading for each day in the logs and remove the day
    from each column.
    
    Closes COUCHDB-2136
    
    I also tested to hack the logic into the view, which would be around 20ms faster, but it wouldn't be testable and more logic in the views, which I want to avoid.

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

    $ git pull https://github.com/robertkowalski/couchdb 2136-group-time-sorter

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

    https://github.com/apache/couchdb/pull/214.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 #214
    
----
commit 17e90332f6e60274ad4896e2bc43e50ff1d27d5b
Author: Robert Kowalski <ro...@kowalski.gd>
Date:   2014-04-19T11:18:22Z

    Group log messages by date
    
    Introduce a heading for each day in the logs and remove the day
    from each column.
    
    Closes COUCHDB-2136

----


---
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.
---

[GitHub] couchdb pull request: Group log messages by date - COUCHDB-2136

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb/pull/214#issuecomment-40943594
  
    Hey @robertkowalski, this looks great. Just some small comments. Once you have made those changes, you can merge it.


---
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.
---

[GitHub] couchdb pull request: Group log messages by date - COUCHDB-2136

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

    https://github.com/apache/couchdb/pull/214#discussion_r11811045
  
    --- Diff: src/fauxton/app/addons/logs/resources.js ---
    @@ -110,7 +119,28 @@ function (app, FauxtonAPI, Backbone, d3) {
         },
     
         serialize: function () {
    -      return { logs: new Log.Collection(this.createFilteredCollection())};
    +      var collection = new Log.Collection(this.createFilteredCollection());
    +
    +      return {
    +        days: this.sortLogsIntoDays(collection)
    +      };
    +    },
    +
    +    sortLogsIntoDays: function (collection) {
    --- End diff --
    
    I think it would make more sense for the collection have have this function than the view. The collection knows what data it holds. It would also make it easier to use this method elsewhere it we needed.


---
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.
---

[GitHub] couchdb pull request: Group log messages by date - COUCHDB-2136

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

    https://github.com/apache/couchdb/pull/214#discussion_r11811097
  
    --- Diff: src/fauxton/app/addons/logs/resources.js ---
    @@ -110,7 +119,28 @@ function (app, FauxtonAPI, Backbone, d3) {
         },
     
         serialize: function () {
    -      return { logs: new Log.Collection(this.createFilteredCollection())};
    +      var collection = new Log.Collection(this.createFilteredCollection());
    +
    +      return {
    +        days: this.sortLogsIntoDays(collection)
    +      };
    +    },
    +
    +    sortLogsIntoDays: function (collection) {
    +      var sortedCollection = {},
    +          date = null;
    +
    +      collection.each(function (log) {
    --- End diff --
    
    You can use `_.reduce` instead of `.each` it will make it much neater and require less variables. We use _.reduce in a couple places, so you can grep for some examples.


---
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.
---

[GitHub] couchdb pull request: Group log messages by date - COUCHDB-2136

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

    https://github.com/apache/couchdb/pull/214#discussion_r11811142
  
    --- Diff: src/fauxton/app/addons/logs/templates/dashboard.html ---
    @@ -17,7 +17,7 @@
       <table class="table table-bordered log-table">
         <thead>
           <tr>
    -        <th class="date">Date</th>
    +        <th class="time">Date</th>
    --- End diff --
    
    Not sure if I've told you but we want to prepend any css that we use in javascript with js-. So this should be `js-time`


---
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.
---

[GitHub] couchdb pull request: Group log messages by date - COUCHDB-2136

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb/pull/214#issuecomment-41135832
  
    +1 looks great. Merge it


---
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.
---

[GitHub] couchdb pull request: Group log messages by date - COUCHDB-2136

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on the pull request:

    https://github.com/apache/couchdb/pull/214#issuecomment-41207342
  
    Merged!


---
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.
---

[GitHub] couchdb pull request: Group log messages by date - COUCHDB-2136

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

    https://github.com/apache/couchdb/pull/214#discussion_r11872399
  
    --- Diff: src/fauxton/app/addons/logs/templates/dashboard.html ---
    @@ -17,7 +17,7 @@
       <table class="table table-bordered log-table">
         <thead>
           <tr>
    -        <th class="date">Date</th>
    +        <th class="time">Date</th>
    --- End diff --
    
    But I am not using it in the JS


---
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.
---

[GitHub] couchdb pull request: Group log messages by date - COUCHDB-2136

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

    https://github.com/apache/couchdb/pull/214


---
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.
---