couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnewson <...@git.apache.org>
Subject [GitHub] couchdb-couch-stats pull request: update_histogram with timing of ...
Date Sun, 02 Nov 2014 18:58:56 GMT
Github user rnewson commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch-stats/pull/3#discussion_r19714082
  
    --- Diff: src/couch_stats.erl ---
    @@ -87,8 +87,19 @@ decrement_counter(Name) ->
     decrement_counter(Name, Value) ->
         notify(Name, {dec, Value}).
     
    --spec update_histogram(any(), number()) -> response().
    -update_histogram(Name, Value) ->
    +-spec update_histogram(any(), number()) -> response();
    +                      (any(), function()) -> any().
    +update_histogram(Name, Fun) when is_function(Fun, 0) ->
    +    Begin = os:timestamp(),
    +    Result = Fun(),
    +    Duration = timer:now_diff(os:timestamp(), Begin) div 1000,
    --- End diff --
    
    except timer:tc/1 doesn't exist in R14, so we can't use it, unfortunately.


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

Mime
View raw message