Changes to support calculation wall-clock time taken by a set of hystrix commands

Added in support for calculation wall-clock time taken by a set of hystrix commands usually within the scope of a request.

Use-Case:
We develop and own a service say postUserComments which in turn depends on a set of independent services say
1. detectSpammyURLInContent
2. detectAbuse
3. postToTwitter
4. buildSecondaryIndices
5. ....

All but buildSecondaryIndices are external services that are beyond the scope of current service/system. These are executed in parallel or in sequence depending upon service semantics.

The added feature will help capture true "wall-clock" overhead of postUserComments service, which can be used by service implementations to monitor/alert and optimize on SLA's guaranteed by services.
Thanks for suggestion Matt. Updated and the new code reflects usage of
System.nanoTime() . I have reflected the changed semantics in method names
as well explicitly. Please look at the updated pull-request.


--

Regards,

Praveen Ramachandra


Got it. Let me put in the change by eod today.
 On Dec 14, 2014 9:20 AM, "Matt Ball" <notifications@github.com> wrote:

> In hystrix-core/src/main/java/com/netflix/hystrix/AbstractCommand.java
> <https://github.com/Netflix/Hystrix/pull/356#discussion-diff-21797619>:
>
> > @@ -1401,6 +1402,12 @@ private ExecutionResult(List<HystrixEventType> events, int executionTime, Except
> >              // because we control the original list in 'newEvent'
> >              this.events = events;
> >              this.executionTime = executionTime;
> > +            if (executionTime >= 0 ) {
> > +                this.commandRunStartTime = System.currentTimeMillis() - this.executionTime;
>
> The main issue with System.currentTimeMillis() is that it's not
> monotonically increasing.
>
> http://stackoverflow.com/a/351571/139010
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Netflix/Hystrix/pull/356/files#r21797619>.
>