Re: Proposal - provide a callback to compute statistics

2016-06-06 Thread Dan Smith
> > Which thread are you proposing to invoke the new statistic provider SPIs?\ > Yeah - that's the tricky question :) For the stats I want to collect, the callbacks could be invoked in the stat sampler thread. But it think it probably makes sense to invoke these callbacks on a separate thread,

Re: Proposal - provide a callback to compute statistics

2016-06-06 Thread Kirk Lund
Which thread are you proposing to invoke the new statistic provider SPIs?\ -Kirk On Thu, Jun 2, 2016 at 2:31 PM, Dan Smith wrote: > On Thu, Jun 2, 2016 at 11:47 AM, Darrel Schneider > wrote: > > > Statistics are supposed to work even if you don't

Re: Proposal - provide a callback to compute statistics

2016-06-02 Thread Dan Smith
On Thu, Jun 2, 2016 at 11:47 AM, Darrel Schneider wrote: > Statistics are supposed to work even if you don't have sampling enabled. > For example you could turn off sampling and not have a statistic archive > but could still run a gfsh command that fetches a bunch of stats

Re: Proposal - provide a callback to compute statistics

2016-06-02 Thread Dan Smith
On Thu, Jun 2, 2016 at 11:23 AM, Jens Deppe wrote: > If the methods are providing a Supplier (to the Statistic) shouldn't they > be called 'set{Int,Long,Double}Supplier'? > Seems reasonable. I'll change them to be set{Int,Long,Double}Supplier

Re: Proposal - provide a callback to compute statistics

2016-06-02 Thread Darrel Schneider
Statistics are supposed to work even if you don't have sampling enabled. For example you could turn off sampling and not have a statistic archive but could still run a gfsh command that fetches a bunch of stats from the running system or use the pulse tool. However you can leave sampling turned

Re: Proposal - provide a callback to compute statistics

2016-06-02 Thread Jens Deppe
If the methods are providing a Supplier (to the Statistic) shouldn't they be called 'set{Int,Long,Double}Supplier'? On Thu, Jun 2, 2016 at 11:04 AM, Dan Smith wrote: > Replies inline. > > On Thu, Jun 2, 2016 at 10:04 AM, Darrel Schneider > wrote: > > >

Re: Proposal - provide a callback to compute statistics

2016-06-02 Thread Dan Smith
Replies inline. On Thu, Jun 2, 2016 at 10:04 AM, Darrel Schneider wrote: > It is not clear to me how the new apis behave. > Is the supplier for a particular id/name/descriptor remembered by the > Statistics instance? So if you wanted to add an intSupplier for a int >

Re: Proposal - provide a callback to compute statistics

2016-06-02 Thread Darrel Schneider
It is not clear to me how the new apis behave. Is the supplier for a particular id/name/descriptor remembered by the Statistics instance? So if you wanted to add an intSupplier for a int statistic you would do it once by calling sampleInt? The name of these methods give the impression that

Re: Proposal - provide a callback to compute statistics

2016-06-01 Thread Dan Smith
I'm suggesting using standard Java 8 function interfaces for the callbacks - IntSupplier, DoubleSupplier, etc. I can change the name of the argument to supplier. -Dan On Wed, Jun 1, 2016 at 4:18 PM, Xiaojian Zhou wrote: > what's the difference btw supplier and sampler? > > On

Re: Proposal - provide a callback to compute statistics

2016-06-01 Thread Xiaojian Zhou
what's the difference btw supplier and sampler? On Wed, Jun 1, 2016 at 4:12 PM, Dan Smith wrote: > Hi, > > I'd like to add some new methods to the Statistics interface to compute > statistics using callbacks. My original motivation for this is to make it > easy to record

Proposal - provide a callback to compute statistics

2016-06-01 Thread Dan Smith
Hi, I'd like to add some new methods to the Statistics interface to compute statistics using callbacks. My original motivation for this is to make it easy to record statistics that come from lucene for our lucene integration, but I think this could simplify recording statistics in a lot of