We had plans to create a new Statistics API [1] for people to use to subscribe to stats and expose them on custom user-implemented MBeans. The use case matches what you want to do. Unfortunately without the completion of that new API, what you're trying to do isn't going to be easy and would require changing Geode itself.
Part of the new Statistics API was implemented around GemFire 7.0 timeframe and currently exists as an internal (non-user) API which the existing Geode MXBeans use to expose stats. The partial API is in org.apache.geode.internal.statistics package and includes StatisticsMonitor (and its sub-classes), StatisticId, StatisticsListener, StatisticsNotification, StatMonitorNotifier. [1] https://cwiki.apache.org/confluence/display/GEODE/Statistics+API On Wed, Jun 21, 2017 at 12:14 PM, Barry Oglesby <bogle...@pivotal.io> wrote: > This will be a nice addition. > > I'm not sure I would create the MBeans for all the registered functions at > once. You'll have to deal with functions being registered on the fly or > after you've called handleFunctionCreation. I think I would change the > handleFunctionCreation to take a Function or FunctionStats (depending on > when you call it) and create the MBean for each function individually. I > can see a couple potential places to call this method whenever each > function is registered. One would be FunctionService.registerFunction or > FunctionServiceManager registerFunction. That could create a placeholder > MBean. Then when the FunctionStats are created later, they could be added > to the appropriate MBean. You don't show when / how you're adding the > FunctionStats to the MBean, but that has to be done somewhere. It might be > easier to call the handleFunctionCreation in InternalDistributedSystem > getFunctionStats when the FunctionStats are created. I'm not sure whether > you need the actual Function instance in the MBean. I guess I would look > into those places to add the handleFunctionCreation. > > > Thanks, > Barry Oglesby > > > On Wed, Jun 21, 2017 at 7:36 AM, Dinesh Akhand <dines...@amdocs.com> > wrote: > > > Hi , > > > > > > > > I have registered all function stats to JMX by creating new bean. > > > > But need to know what Is the correct place register this bean. > > > > > > > > I did like this : > > > > > > > > public void handleFunctionCreation() throws ManagementException { > > > > Map<String, Function> functionMap = FunctionService. > > getRegisteredFunctions(); > > > > logger.info("akhand :functionMap:"+functionMap.size()); > > > > for(String funid :functionMap.keySet()) > > > > { > > > > Function functionDetail= functionMap.get(funid); > > > > FunctionStatsMBeanBridge functionStatsMBeanBridge = new > > FunctionStatsMBeanBridge(functionDetail,cacheImpl, service); > > > > FunctionStatsMXBean functionBean = new FunctionStatsMBean( > > functionStatsMBeanBridge); > > > > ObjectName senderObjectName = MBeanJMXAdapter. > > getFunctionStatsMBeanName( > > > > cacheImpl.getDistributedSystem(). > getDistributedMember(), > > funid); > > > > ObjectName changedFunctionMBeanName = > > service.registerInternalMBean(functionBean, senderObjectName); > > > > > > > > service.federate(changedFunctionMBeanName, > > FunctionStatsMXBean.class, true); > > > > } > > > > } > > > > > > > > But from where I need to call this method . > > > > Currently I called above method from ManagementListener.java > > > > case CACHE_SERVER_START: > > > > CacheServer startedServer = (CacheServer) resource; > > > > adapter.handleCacheServerStart(startedServer); > > > > adapter.handleFunctionCreation(); > > > > break; > > > > > > > > Please suggest. > > > > > > > > Thanks, > > > > Dinesh Akhand > > > > > > > > > > > > > > > > -----Original Message----- > > From: Dinesh Akhand > > Sent: Friday, June 9, 2017 6:44 PM > > To: dev@geode.apache.org; bogle...@pivotal.io > > Subject: RE: Need information about FunctionStatistics > > > > > > > > Hi Team, > > > > > > > > Problem Solved , > > > > > > > > Function Stats works fine if function is associated with JVM . else it > > will display 0 . > > > > > > > > Thanks, > > > > Dinesh Akhand > > > > > > > > From: Dinesh Akhand > > > > Sent: Friday, June 9, 2017 4:34 PM > > > > To: dev@geode.apache.org; 'bogle...@pivotal.io' <bogle...@pivotal.io> > > > > Subject: RE: Need information about FunctionStatistics > > > > > > > > > > > > Hi Barry, > > > > > > > > > > > > > > > > Yes , I can see the function statics in VSD but looks like > > > > > > > > > > > > > > > > All the stats are 0 . not even for single function stats are correct . > > > > > > > > > > > > > > > > FunctionExecution, 2265, FunctionServiceStatistics: "2017/06/07 > > 12:11:09.201 IDT" samples=502 > > > > > > > > functionExecutionsCompleted operations/sec: samples=501 min=0 max=0.2 > > average=0 stddev=0.01 last=0 > > > > > > > > functionExecutionsCompletedProcessingTime nanoseconds/sec: samples=501 > > min=0 max=190219.8 average=379.68 stddev=8498.39 last=0 > > > > > > > > functionExecutionsRunning operations: samples=502 min=0 max=0 average=0 > > stddev=0 last=0 > > > > > > > > resultsSentToResultCollector operations/sec: samples=501 min=0 max=0.2 > > average=0 stddev=0.01 last=0 > > > > > > > > resultsReceived operations/sec: samples=501 min=0 max=0 average=0 > > stddev=0 last=0 > > > > > > > > functionExecutionCalls operations/sec: samples=501 min=0 max=0.2 > > average=0 stddev=0.01 last=0 > > > > > > > > functionExecutionsHasResultCompletedProcessingTime nanoseconds/sec: > > samples=501 min=0 max=190219.8 average=379.68 stddev=8498.39 last=0 > > > > > > > > functionExecutionsHasResultRunning operations: samples=502 min=0 max=0 > > average=0 stddev=0 last=0 > > > > > > > > functionExecutionsExceptions operations/sec: samples=501 min=0 max=0 > > average=0 stddev=0 last=0 > > > > > > > > > > > > > > > > Can you please confirm function stats values are correct in your case. > > > > > > > > > > > > > > > > Thanks, > > > > > > > > Dinesh Akhand > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: Barry Oglesby [mailto:bogle...@pivotal.io <bogle...@pivotal.io>] > > > > Sent: Thursday, June 8, 2017 10:38 PM > > > > To: dev@geode.apache.org<mailto:dev@geode.apache.org> > > > > Subject: Re: Need information about FunctionStatistics > > > > > > > > > > > > > > > > Dinesh, > > > > > > > > > > > > > > > > The FunctionStatistics and FunctionServiceStatistics look to be > displaying > > properly in vsd. Are you not seeing them? > > > > > > > > > > > > > > > > Thanks, > > > > > > > > Barry Oglesby > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Jun 8, 2017 at 9:51 AM, Kirk Lund <kl...@apache.org<mailto: > > kl...@apache.org>> wrote: > > > > > > > > > > > > > > > > > I think we would probably need to introduce a new > > > > > > > > > FunctionServiceMXBean with these stats as attributes or add > > > > > > > > > showFunctionMetrics() operation to MemberMXBean. > > > > > > > > > > > > > > > > > > On Wed, Jun 7, 2017 at 6:32 AM, Dinesh Akhand < > > dines...@amdocs.com<mailto:dines...@amdocs.com>> wrote: > > > > > > > > > > > > > > > > > > > Hi Team, > > > > > > > > > > > > > > > > > > > > Currently I can see Function stats are getting generated . > > > > > > > > > > functionExecutionsCompleted operations/sec: samples=1955 min=0 max=0 > > > > > > > > > > average=0 stddev=0 last=0 > > > > > > > > > > functionExecutionsCompletedProcessingTime nanoseconds/sec: > > > > > > > > > samples=1955 > > > > > > > > > > min=0 max=0 average=0 stddev=0 last=0 > > > > > > > > > > functionExecutionsRunning operations: samples=1956 min=0 max=0 > > > > > > > > > average=0 > > > > > > > > > > stddev=0 last=0 > > > > > > > > > > resultsSentToResultCollector operations/sec: samples=1955 min=0 > > > > > > > > > > max=2.6 > > > > > > > > > > average=0 stddev=0.1 last=0 > > > > > > > > > > resultsReceived operations/sec: samples=1955 min=0 max=2.6 > > > > > > > > > > average=0 > > > > > > > > > > stddev=0.1 last=0 > > > > > > > > > > functionExecutionCalls operations/sec: samples=1955 min=0 max=0 > > > > > > > > > > average=0 stddev=0 last=0 > > > > > > > > > > > > > > > > > > > > but I am not able to see them on JMX . > > > > > > > > > > > > > > > > > > > > I found last end point in MemberMBeanBridge for JMX. Is there any > > > > > > > > > > information and document can you provide. > > > > > > > > > > I want to publish FunctionStatistics on JMX , any suggestion will be > > > > > > > > > > welcome. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Thanks, > > > > > > > > > > Dinesh Akhand > > > > > > > > > > This message and the information contained herein is proprietary and > > > > > > > > > > confidential and subject to the Amdocs policy statement, > > > > > > > > > > > > > > > > > > > > you may review at https://www.amdocs.com/about/email-disclaimer < > > > > > > > > > > https://www.amdocs.com/about/email-disclaimer> > > > > > > > > > > > > > > > > > > > > > > > This message and the information contained herein is proprietary and > > confidential and subject to the Amdocs policy statement, > > > > > > > > you may review at https://www.amdocs.com/about/email-disclaimer < > > https://www.amdocs.com/about/email-disclaimer> > > This message and the information contained herein is proprietary and > > confidential and subject to the Amdocs policy statement, > > you may review at https://www.amdocs.com/about/email-disclaimer > > >