AuxCounters
Henri Tremblay
henri.tremblay at gmail.com
Mon Mar 6 21:15:09 UTC 2017
Ok. That was my understanding so far.
Then, I don't understand how it's calculated. Lets say I use OPERATIONS and
Throughput (per second). And I increment once the counter. I will get the
number of time the counter was incremented per second? And then the average
time is what? 1/throughput?
Now, for my original question. Will it be crazy to have a way to split
executions according to an enum returned by the benchmarked method? By
crazy I mean impossible. Or a boolean.
Thanks,
Henri
On 6 March 2017 at 13:27, Aleksey Shipilev <shade at redhat.com> wrote:
> Hi Henry,
>
> On 03/06/2017 05:17 PM, Henri Tremblay wrote:
> > I want to do something basic but haven't found a way.
>
> This is not as basic as you'd think.
>
> > I played with auxiliary counters but after reading the doc, I've
> definitely
> > failed to understand it it seems.
> >
> > I want to do this:
> >
> > @Benchmark
> > @Threads(Threads.MAX)
> > public String cacheAccess() {
> >
> > return cache.get(key);
> >
> > }
> >
> > And have the time when the method returns null and when if returns
> > something else.
> >
> > Is there a way?
>
> No, there is no way. @AuxCounters work for Throughput/AverageTime because
> they
> can record "counters" that you can increment. If you want conditional
> per-sample
> timing measurement, that is not enough.
>
> -Aleksey
>
>
More information about the jmh-dev
mailing list