GitHub user zd-project opened a pull request:
https://github.com/apache/storm/pull/2743
[STORM-3130]: Add Wrappers for Timer registration and timed object
This idea was originally conceived because a few Storm server metrics were
requested on timing procedure's efficiency (e.g., how long does it take for a
file/jar to be uploaded, how long does it takes to actually launch an
assignment in the worker). Since many operations are processed asynchronously,
there's no easy way to track the timing. However I noticed that in many cases,
even the operation itself is convoluted, the object on which the operation
applied is likely to be passed along all method invocation, which gives us a
way to keep track the time of a procedure by observing the lifespan of the
targeted object.
I've tried to attach the timer to existing object through decorator or
through inheritance, and they seem both to be working in certain situations.
But to me it's still not ideal to have different patterns that implements the
same functionality. I'd appreciate if you can have any suggestions on how I
should tackle this problem.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zd-project/storm STORM-3130
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/storm/pull/2743.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 #2743
----
commit 5db6ef1bef73593ff77ec9438f3b1543a0e3d53e
Author: Zhengdai Hu <hu.zhengdai@...>
Date: 2018-06-18T15:44:19Z
STORM-3030: Add Timer registration wrapper.
(cherry picked from commit 5338491)
commit 3d569261308e51fcfb45395bb533e4f3d88e4c23
Author: Zhengdai Hu <hu.zhengdai@...>
Date: 2018-06-27T19:46:33Z
STORM-3130: Added object wrapper with timer in both decorator and
inheritance patterns.
----
---