Hello and possible addition

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Hello and possible addition

Otto Fowler
Hello Commons,

My name is Otto Fowler ( ottobackwards on github, otto -AT- apache.org at
apache ), and I’m a PMC member of the Apache Metron
<https://metron.apache.org> project.

While working on adding some timing functionality to a Metron feature, I
came across the
Stopwatch
<https://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/time/StopWatch.html>
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
<https://github.com/apache/metron/tree/master/metron-stellar/stellar-common>
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 <https://github.com/ottobackwards/StackWatch>
to provide this functionality, and submitted it in a Metron PR
<https://github.com/apache/metron/pull/873>.

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.

See the StackWatch tests for examples of nested function timings.
------------------------------

A quick look at the PR and it’s test or the github project ( they are in
sync ) should show the idea.

I am sending this to see if this functionality would be appropriate for
commons in some way. If so, the I can create the jira and submit the pr.
Even if it is not appropriate, any feedback or pr’s on the github project
would still be most welcome.

Thanks for all the work that has made commons so valuable to other Apache
projects and java developers in general!
Reply | Threaded
Open this post in threaded view
|

[LANG] Re: Hello and possible addition

Otto Fowler
Sorry, didn’t put the right prefix.


On January 1, 2018 at 22:28:45, Otto Fowler ([hidden email]) wrote:

Hello Commons,

My name is Otto Fowler ( ottobackwards on github, otto -AT- apache.org at
apache ), and I’m a PMC member of the Apache Metron
<https://metron.apache.org> project.

While working on adding some timing functionality to a Metron feature, I
came across the
Stopwatch
<https://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/time/StopWatch.html>
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
<https://github.com/apache/metron/tree/master/metron-stellar/stellar-common>
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 <https://github.com/ottobackwards/StackWatch>
to provide this functionality, and submitted it in a Metron PR
<https://github.com/apache/metron/pull/873>.

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.

See the StackWatch tests for examples of nested function timings.
------------------------------

A quick look at the PR and it’s test or the github project ( they are in
sync ) should show the idea.

I am sending this to see if this functionality would be appropriate for
commons in some way. If so, the I can create the jira and submit the pr.
Even if it is not appropriate, any feedback or pr’s on the github project
would still be most welcome.

Thanks for all the work that has made commons so valuable to other Apache
projects and java developers in general!
Reply | Threaded
Open this post in threaded view
|

Re: Hello and possible addition

Benedikt Ritter-4
In reply to this post by Otto Fowler
Hello Otto,

> Am 02.01.2018 um 04:28 schrieb Otto Fowler <[hidden email]>:
>
> Hello Commons,
>
> My name is Otto Fowler ( ottobackwards on github, otto -AT- apache.org at
> apache ), and I’m a PMC member of the Apache Metron
> <https://metron.apache.org> project.
>
> While working on adding some timing functionality to a Metron feature, I
> came across the
> Stopwatch
> <https://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/time/StopWatch.html>
> 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
> <https://github.com/apache/metron/tree/master/metron-stellar/stellar-common>
> 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 <https://github.com/ottobackwards/StackWatch>
> to provide this functionality, and submitted it in a Metron PR
> <https://github.com/apache/metron/pull/873>.
>
> 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.
>
> See the StackWatch tests for examples of nested function timings.
> ------------------------------
>
> A quick look at the PR and it’s test or the github project ( they are in
> sync ) should show the idea.
>
> I am sending this to see if this functionality would be appropriate for
> commons in some way. If so, the I can create the jira and submit the pr.
> Even if it is not appropriate, any feedback or pr’s on the github project
> would still be most welcome.
>
> Thanks for all the work that has made commons so valuable to other Apache
> projects and java developers in general!

This sounds like a useful tool. Nobody objected against adding it to commons lang, so I don’t see a reason not to include it. All Apache committers have write access to the commons repositories, so you good go ahead and add it yourself! But maybe it makes sense to create a Pull Request against the commons lang GitHub mirror so people are triggered to have a look :-)

Regards,
Benedikt


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Hello and possible addition

Otto Fowler
Thanks,

I will definitely do a PR and get a review.  I am sure review will make it
better.



On January 3, 2018 at 02:06:37, Benedikt Ritter ([hidden email]) wrote:

Hello Otto,

> Am 02.01.2018 um 04:28 schrieb Otto Fowler <[hidden email]>:
>
> Hello Commons,
>
> My name is Otto Fowler ( ottobackwards on github, otto -AT- apache.org at
> apache ), and I’m a PMC member of the Apache Metron
> <https://metron.apache.org> project.
>
> While working on adding some timing functionality to a Metron feature, I
> came across the
> Stopwatch
> <
https://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/time/StopWatch.html>

> 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
> <
https://github.com/apache/metron/tree/master/metron-stellar/stellar-common>
> 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 <https://github.com/ottobackwards/StackWatch>

> to provide this functionality, and submitted it in a Metron PR
> <https://github.com/apache/metron/pull/873>.
>
> 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.
>
> See the StackWatch tests for examples of nested function timings.
> ------------------------------
>
> A quick look at the PR and it’s test or the github project ( they are in
> sync ) should show the idea.
>
> I am sending this to see if this functionality would be appropriate for
> commons in some way. If so, the I can create the jira and submit the pr.
> Even if it is not appropriate, any feedback or pr’s on the github project
> would still be most welcome.
>
> Thanks for all the work that has made commons so valuable to other Apache
> projects and java developers in general!

This sounds like a useful tool. Nobody objected against adding it to
commons lang, so I don’t see a reason not to include it. All Apache
committers have write access to the commons repositories, so you good go
ahead and add it yourself! But maybe it makes sense to create a Pull
Request against the commons lang GitHub mirror so people are triggered to
have a look :-)

Regards,
Benedikt


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Hello and possible addition

Otto Fowler
Just to check, Java 7 is the required language level?


On January 3, 2018 at 07:12:03, Otto Fowler ([hidden email]) wrote:

While working on adding some timing functionality to a Metron feature, I
came across the
Stopwatch
<https://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/time/StopWatch.html>
 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
<https://github.com/apache/metron/tree/master/metron-stellar/stellar-common>
 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 <https://github.com/ottobackwards/StackWatch> to
provide this functionality, and submitted it in a Metron PR
<https://github.com/apache/metron/pull/873>.

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.

See the StackWatch tests for examples of nested function timings.
------------------------------

A quick look at the PR and it’s test or the github project ( they are in
sync ) should show the idea.

I am sending this to see if this functionality would be appropriate for
commons in some way. If so, the I can create the jira and submit the pr.
Even if it is not appropriate, any feedback or pr’s on the github project
would still be most welcome.

Thanks for all the work that has made commons so valuable to other Apache
projects and java developers in general!
Reply | Threaded
Open this post in threaded view
|

Re: Hello and possible addition

Benedikt Ritter-4


> Am 03.01.2018 um 15:02 schrieb Otto Fowler <[hidden email]>:
>
> Just to check, Java 7 is the required language level?

Yes

>
>
> On January 3, 2018 at 07:12:03, Otto Fowler ([hidden email]) wrote:
>
> While working on adding some timing functionality to a Metron feature, I
> came across the
> Stopwatch
> <https://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/time/StopWatch.html>
> 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
> <https://github.com/apache/metron/tree/master/metron-stellar/stellar-common>
> 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 <https://github.com/ottobackwards/StackWatch> to
> provide this functionality, and submitted it in a Metron PR
> <https://github.com/apache/metron/pull/873>.
>
> 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.
>
> See the StackWatch tests for examples of nested function timings.
> ------------------------------
>
> A quick look at the PR and it’s test or the github project ( they are in
> sync ) should show the idea.
>
> I am sending this to see if this functionality would be appropriate for
> commons in some way. If so, the I can create the jira and submit the pr.
> Even if it is not appropriate, any feedback or pr’s on the github project
> would still be most welcome.
>
> Thanks for all the work that has made commons so valuable to other Apache
> projects and java developers in general!


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Hello and possible addition

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


On January 3, 2018 at 09:05:37, Benedikt Ritter ([hidden email]) wrote:



> Am 03.01.2018 um 15:02 schrieb Otto Fowler <[hidden email]>:
>
> Just to check, Java 7 is the required language level?

Yes

>
>
> On January 3, 2018 at 07:12:03, Otto Fowler ([hidden email])
wrote:
>
> While working on adding some timing functionality to a Metron feature, I
> came across the
> Stopwatch
> <
https://commons.apache.org/proper/commons-lang/javadocs/api-release/org/apache/commons/lang3/time/StopWatch.html>

> 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
> <
https://github.com/apache/metron/tree/master/metron-stellar/stellar-common>
> 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 <https://github.com/ottobackwards/StackWatch>
to

> provide this functionality, and submitted it in a Metron PR
> <https://github.com/apache/metron/pull/873>.
>
> 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.
>
> See the StackWatch tests for examples of nested function timings.
> ------------------------------
>
> A quick look at the PR and it’s test or the github project ( they are in
> sync ) should show the idea.
>
> I am sending this to see if this functionality would be appropriate for
> commons in some way. If so, the I can create the jira and submit the pr.
> Even if it is not appropriate, any feedback or pr’s on the github project
> would still be most welcome.
>
> Thanks for all the work that has made commons so valuable to other Apache
> projects and java developers in general!


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]