You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/03 19:32:00 UTC

[jira] [Commented] (LANG-1373) Stopwatch based capability for nested, named, timings in a call stack

    [ https://issues.apache.org/jira/browse/LANG-1373?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16310154#comment-16310154 ] 

ASF GitHub Bot commented on LANG-1373:
--------------------------------------

GitHub user ottobackwards opened a pull request:

    https://github.com/apache/commons-lang/pull/311

    LANG-1373 Stopwatch based capability for nested, named, timings 

    There are times when you want to do a number or related timings across a sequence of calls or operations.  This is difficult to do with just the StopWatch.
    
    StackWatch provides an abstraction over the  StopWatch class that allows callers to create multiple named and possibly nested timing operations.
    
    StackWatch uses a combination of Deque and a custom Tree implementation to create, start and end timing operations.
    
    A Visitor pattern is also implemented to allow for retrieving the results after the completion of the operation, and timings may be tagged to allow the consumer to filter the results.
    
    
    
    I have built this in my personal travis and all three jobs pass


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

    $ git pull https://github.com/ottobackwards/commons-lang stackwatch

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

    https://github.com/apache/commons-lang/pull/311.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 #311
    
----
commit dd09e9225aba05e854fb1b8a4611450248d38dd3
Author: Otto Fowler <ot...@...>
Date:   2018-01-03T17:19:07Z

    StackWatch implementation and tests

commit ddaab51568ab01fc883d30e66394a669a75e24cc
Author: Otto Fowler <ot...@...>
Date:   2018-01-03T19:30:28Z

    fix wording in javadoc

----


> Stopwatch based capability for nested, named, timings in a call stack
> ---------------------------------------------------------------------
>
>                 Key: LANG-1373
>                 URL: https://issues.apache.org/jira/browse/LANG-1373
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.time.*
>            Reporter: Otto Fowler
>
> While working on adding some timing functionality to a Metron feature, I came across the
> Stopwatch class, but found that it didn’t suite my needs.
> What I wanted to do was to create a timing from a top level function in our Stellar dsl, and have have a group of related timings, such that the end result was the overall time of the call, and nested timings of other calls executed during the dsl execution of that function. These timings would all be named, and have a path for identification and include timing the language compiler/execution as well as the function execution itself. It would be helpful if they were tagged in some way as well, such that the consumer could filter during visitation.
> So I have written StackWatch to provide this functionality, and submitted it in a Metron PR.
> From the PR description:
> StackWatch
> A set of utility classes under the new package stellar.common.timing have been added. These provide the StackWatch functionality.
> StackWatch provides an abstraction over the Apache Commons StopWatch class that allows callers to create multiple named and possibly nested timing operations.
> <…>
> This class may be more generally useful to this and other projects, but I am not sure where it would live since we wouldn’t want it in common.
> StackWatch uses a combination of Deque and a custom Tree implementation to create, start and end timing operations.
> A Visitor pattern is also implemented to allow for retrieving the results after the completion of the operation.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)