You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@aurora.apache.org by Mohit Jaggi <mo...@uber.com> on 2017/12/02 20:17:09 UTC

sliding stats testing

Folks,
I am trying to write a test case and could not find one to refer to. I want
to set writerWaitStats below to a large value to simulate high values for
log_storage_write_lock_wait_ns_per_event
I tried calling accumulate once with a large value or several times with
large values but it is always zero for
log_storage_write_lock_wait_ns_per_event
What am I missing?

Mohit.


private SlidingStats writerWaitStats = new
SlidingStats("log_storage_write_lock_wait", "ns");

writerWaitStats.accumulate(100000000000000000L);

Re: sliding stats testing

Posted by Mohit Jaggi <mo...@uber.com>.
Bill,
Thanks for the pointer. However, it is not clear to me how I would do this.
I would appreciate more details or a pointer to an existing test case I can
use as a reference.

I was hoping to mock Stats and then mock SlidingStats.getPerEventLatency()
but Stats.getVariable() is static so that won't work out :(


On Sat, Dec 2, 2017 at 12:33 PM, Bill Farner <wf...@apache.org> wrote:

> The underlying Rate stats used here are only updated when sampled, so the
> value you have sent to accumulate() is not reflected in rates and ratios
> until doSample() is called on them.  For the purposes of this test, it may
> be easiest to integrate with TimeSeriesRepositoryImpl and manually induce
> sampling.
>
> On Sat, Dec 2, 2017 at 12:17 PM, Mohit Jaggi <mo...@uber.com> wrote:
>
>> Folks,
>> I am trying to write a test case and could not find one to refer to. I
>> want to set writerWaitStats below to a large value to simulate high values
>> for log_storage_write_lock_wait_ns_per_event
>> I tried calling accumulate once with a large value or several times with
>> large values but it is always zero for log_storage_write_lock_wai
>> t_ns_per_event
>> What am I missing?
>>
>> Mohit.
>>
>>
>> private SlidingStats writerWaitStats = new SlidingStats("log_storage_write_lock_wait", "ns");
>>
>> writerWaitStats.accumulate(100000000000000000L);
>>
>>
>

Re: sliding stats testing

Posted by Bill Farner <wf...@apache.org>.
The underlying Rate stats used here are only updated when sampled, so the
value you have sent to accumulate() is not reflected in rates and ratios
until doSample() is called on them.  For the purposes of this test, it may
be easiest to integrate with TimeSeriesRepositoryImpl and manually induce
sampling.

On Sat, Dec 2, 2017 at 12:17 PM, Mohit Jaggi <mo...@uber.com> wrote:

> Folks,
> I am trying to write a test case and could not find one to refer to. I
> want to set writerWaitStats below to a large value to simulate high values
> for log_storage_write_lock_wait_ns_per_event
> I tried calling accumulate once with a large value or several times with
> large values but it is always zero for log_storage_write_lock_
> wait_ns_per_event
> What am I missing?
>
> Mohit.
>
>
> private SlidingStats writerWaitStats = new SlidingStats("log_storage_write_lock_wait", "ns");
>
> writerWaitStats.accumulate(100000000000000000L);
>
>