You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Jian Qiu <go...@gmail.com> on 2016/04/22 12:16:39 UTC

How to record time elapsed of a set of async functions operation?

Hi folks,

We are trying to do some performance tests for Mesos, and intend to add log
to output the time duration for different kinds of operation. There is a
Stopwatch class that can calculate the time elapsed for a blocking call.
However, I am wondering if there is some utility to record the time elapsed
for a async call chain. For instance, Mesos always have a chain like
 future.then(xxx).onAny.....  Is there anyway to calculate the whole time
elapsed of this kind of chain instead of printing out the time stamp?

Thanks.

Regards
Qiu Jian

Re: How to record time elapsed of a set of async functions operation?

Posted by tommy xiao <xi...@gmail.com>.
for feasible proposal, we can provide a doc to record the zipkin's usage.

2016-04-23 11:11 GMT+08:00 haosdent <ha...@gmail.com>:

> Maybe we could integrated Mesos with Zipkin
> https://github.com/openzipkin/zipkin , so that it would display the
> latency
> more obviously.
>
> On Sat, Apr 23, 2016 at 7:42 AM, Joris Van Remoortere <joris@mesosphere.io
> >
> wrote:
>
> > To be clear, BenM's example will result in the total wall-clock time for
> > the chain to complete, rather than the sum of time actually spent in
> those
> > functions.
> >
> >
> > —
> > *Joris Van Remoortere*
> > Mesosphere
> >
> > On Fri, Apr 22, 2016 at 4:26 PM, Benjamin Mahler <bm...@apache.org>
> > wrote:
> >
> > > Here's an example of using Stopwatch for this:
> > >
> > > Future<Nothing> f = Nothing();
> > > Stopwatch s;
> > >
> > > s.start();
> > > f.then(a)
> > >  .then(b)
> > >  .then(c)
> > >  .onAny([s](){ cout << "a->b->c took: " << s.elapsed() << endl; });
> > >
> > > On Fri, Apr 22, 2016 at 3:16 AM, Jian Qiu <go...@gmail.com>
> > wrote:
> > >
> > > > Hi folks,
> > > >
> > > > We are trying to do some performance tests for Mesos, and intend to
> add
> > > log
> > > > to output the time duration for different kinds of operation. There
> is
> > a
> > > > Stopwatch class that can calculate the time elapsed for a blocking
> > call.
> > > > However, I am wondering if there is some utility to record the time
> > > elapsed
> > > > for a async call chain. For instance, Mesos always have a chain like
> > > >  future.then(xxx).onAny.....  Is there anyway to calculate the whole
> > time
> > > > elapsed of this kind of chain instead of printing out the time stamp?
> > > >
> > > > Thanks.
> > > >
> > > > Regards
> > > > Qiu Jian
> > > >
> > >
> >
>
>
>
> --
> Best Regards,
> Haosdent Huang
>



-- 
Deshi Xiao
Twitter: xds2000
E-mail: xiaods(AT)gmail.com

Re: How to record time elapsed of a set of async functions operation?

Posted by haosdent <ha...@gmail.com>.
Maybe we could integrated Mesos with Zipkin
https://github.com/openzipkin/zipkin , so that it would display the latency
more obviously.

On Sat, Apr 23, 2016 at 7:42 AM, Joris Van Remoortere <jo...@mesosphere.io>
wrote:

> To be clear, BenM's example will result in the total wall-clock time for
> the chain to complete, rather than the sum of time actually spent in those
> functions.
>
>
> —
> *Joris Van Remoortere*
> Mesosphere
>
> On Fri, Apr 22, 2016 at 4:26 PM, Benjamin Mahler <bm...@apache.org>
> wrote:
>
> > Here's an example of using Stopwatch for this:
> >
> > Future<Nothing> f = Nothing();
> > Stopwatch s;
> >
> > s.start();
> > f.then(a)
> >  .then(b)
> >  .then(c)
> >  .onAny([s](){ cout << "a->b->c took: " << s.elapsed() << endl; });
> >
> > On Fri, Apr 22, 2016 at 3:16 AM, Jian Qiu <go...@gmail.com>
> wrote:
> >
> > > Hi folks,
> > >
> > > We are trying to do some performance tests for Mesos, and intend to add
> > log
> > > to output the time duration for different kinds of operation. There is
> a
> > > Stopwatch class that can calculate the time elapsed for a blocking
> call.
> > > However, I am wondering if there is some utility to record the time
> > elapsed
> > > for a async call chain. For instance, Mesos always have a chain like
> > >  future.then(xxx).onAny.....  Is there anyway to calculate the whole
> time
> > > elapsed of this kind of chain instead of printing out the time stamp?
> > >
> > > Thanks.
> > >
> > > Regards
> > > Qiu Jian
> > >
> >
>



-- 
Best Regards,
Haosdent Huang

Re: How to record time elapsed of a set of async functions operation?

Posted by Joris Van Remoortere <jo...@mesosphere.io>.
To be clear, BenM's example will result in the total wall-clock time for
the chain to complete, rather than the sum of time actually spent in those
functions.


—
*Joris Van Remoortere*
Mesosphere

On Fri, Apr 22, 2016 at 4:26 PM, Benjamin Mahler <bm...@apache.org> wrote:

> Here's an example of using Stopwatch for this:
>
> Future<Nothing> f = Nothing();
> Stopwatch s;
>
> s.start();
> f.then(a)
>  .then(b)
>  .then(c)
>  .onAny([s](){ cout << "a->b->c took: " << s.elapsed() << endl; });
>
> On Fri, Apr 22, 2016 at 3:16 AM, Jian Qiu <go...@gmail.com> wrote:
>
> > Hi folks,
> >
> > We are trying to do some performance tests for Mesos, and intend to add
> log
> > to output the time duration for different kinds of operation. There is a
> > Stopwatch class that can calculate the time elapsed for a blocking call.
> > However, I am wondering if there is some utility to record the time
> elapsed
> > for a async call chain. For instance, Mesos always have a chain like
> >  future.then(xxx).onAny.....  Is there anyway to calculate the whole time
> > elapsed of this kind of chain instead of printing out the time stamp?
> >
> > Thanks.
> >
> > Regards
> > Qiu Jian
> >
>

Re: How to record time elapsed of a set of async functions operation?

Posted by Benjamin Mahler <bm...@apache.org>.
Here's an example of using Stopwatch for this:

Future<Nothing> f = Nothing();
Stopwatch s;

s.start();
f.then(a)
 .then(b)
 .then(c)
 .onAny([s](){ cout << "a->b->c took: " << s.elapsed() << endl; });

On Fri, Apr 22, 2016 at 3:16 AM, Jian Qiu <go...@gmail.com> wrote:

> Hi folks,
>
> We are trying to do some performance tests for Mesos, and intend to add log
> to output the time duration for different kinds of operation. There is a
> Stopwatch class that can calculate the time elapsed for a blocking call.
> However, I am wondering if there is some utility to record the time elapsed
> for a async call chain. For instance, Mesos always have a chain like
>  future.then(xxx).onAny.....  Is there anyway to calculate the whole time
> elapsed of this kind of chain instead of printing out the time stamp?
>
> Thanks.
>
> Regards
> Qiu Jian
>