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 <wfar...@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 <mohit.ja...@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); >> >> >