You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Jörn Kottmann <ko...@gmail.com> on 2008/10/24 16:24:08 UTC

Getting AE performance stats

Hello,

I am trying to retrieve performance stats from an AnalysisEngine
with the AnalysisEngineManagement object instance I got via the
AE.getManagementInterface method, but all stats are 0 e.g.
for AEM.getNumberOfCasProcessed().

I created the AE from a pear. And then this
small loop drives the processing:

CAS cas = ae.newCAS();
while (colReader.hasNext()) {
    colReader.getNext(cas);			
    ae.process(cas);					
    cas.reset();
}

If I now try to use the management interface I do not
get correct stats, only zero as described above.

What do I am doing wrong ? Is there a switch
to explicitly enable performance monitoring ?

I have one more question.
Is it safe to use a second thread to retrieve the
performance stats ?

Thanks,
Jörn



Re: Getting AE performance stats

Posted by Jörn Kottmann <ko...@gmail.com>.
I did not found time to dig further last time, but now I did
and found out that the PearAnalysisEngineWrapper
does not provide access to the AnalysisEngineManagement object
of the wrapped AE. Which means that only a virgin
AnalysisEngineManagement object can be retrieved from
the PearAnalysisEngineWrapper.

> Are you running the PEAR from within an aggregate (an aggregate
> containing only one delegate - the pear descriptor)?
>   
Yes, I get the pear descriptor and use it to create the
analysis engine.

Here is my code:
XMLInputSource in = new XMLInputSource(instPear
        .getComponentPearDescPath());
               
ResourceSpecifier specifier = UIMAFramework.getXMLParser()
        .parseResourceSpecifier(in);

ResourceManager rsrcMgr = UIMAFramework.newDefaultResourceManager();
              
AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(
        specifier, rsrcMgr, null);

Jörn

Re: Getting AE performance stats

Posted by Jaroslaw Cwiklik <cw...@us.ibm.com>.




Try to attach jConsole to the jvm and see if the stats for the AE are shown
there. You may need to enable JMX  by
adding the following to the run command:

-Dcom.sun.management.jmxremote

JC
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Jerry Cwiklik
 UIMA Extensions
 IBM T.J.  Watson Research Center
 Hawtorne, NY, 10532
 Tel: 914-784-7665,  T/L: 863-7665
 Email: cwiklik@us.ibm.com



                                                                           
             Marshall Schor                                                
             <ms...@schor.com>                                               
                                                                        To 
             10/29/2008 12:12          uima-user@incubator.apache.org      
             PM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: Getting AE performance stats    
             uima-user@incubat                                             
               or.apache.org                                               
                                                                           
                                                                           
                                                                           
                                                                           




I'm not too familiar with this code.  It looks like it should work.  If
you can run in the debugger, you can probably quickly figure out what's
going wrong - try putting a stop in the AnalysisEngineManagement code
where the counters get incremented - if that's not being hit, then
there's a call/hook missing.

Are you running the PEAR from within an aggregate (an aggregate
containing only one delegate - the pear descriptor)?

-Marshall

Jörn Kottmann wrote:
> Hello,
>
> I am trying to retrieve performance stats from an AnalysisEngine
> with the AnalysisEngineManagement object instance I got via the
> AE.getManagementInterface method, but all stats are 0 e.g.
> for AEM.getNumberOfCasProcessed().
>
> I created the AE from a pear. And then this
> small loop drives the processing:
>
> CAS cas = ae.newCAS();
> while (colReader.hasNext()) {
>    colReader.getNext(cas);
>    ae.process(cas);
>    cas.reset();
> }
>
> If I now try to use the management interface I do not
> get correct stats, only zero as described above.
>
> What do I am doing wrong ? Is there a switch
> to explicitly enable performance monitoring ?
>
> I have one more question.
> Is it safe to use a second thread to retrieve the
> performance stats ?
>
> Thanks,
> Jörn
>
>
>

Re: Getting AE performance stats

Posted by Marshall Schor <ms...@schor.com>.
I'm not too familiar with this code.  It looks like it should work.  If
you can run in the debugger, you can probably quickly figure out what's
going wrong - try putting a stop in the AnalysisEngineManagement code
where the counters get incremented - if that's not being hit, then
there's a call/hook missing.

Are you running the PEAR from within an aggregate (an aggregate
containing only one delegate - the pear descriptor)?

-Marshall

Jörn Kottmann wrote:
> Hello,
>
> I am trying to retrieve performance stats from an AnalysisEngine
> with the AnalysisEngineManagement object instance I got via the
> AE.getManagementInterface method, but all stats are 0 e.g.
> for AEM.getNumberOfCasProcessed().
>
> I created the AE from a pear. And then this
> small loop drives the processing:
>
> CAS cas = ae.newCAS();
> while (colReader.hasNext()) {
>    colReader.getNext(cas);           
>    ae.process(cas);                   
>    cas.reset();
> }
>
> If I now try to use the management interface I do not
> get correct stats, only zero as described above.
>
> What do I am doing wrong ? Is there a switch
> to explicitly enable performance monitoring ?
>
> I have one more question.
> Is it safe to use a second thread to retrieve the
> performance stats ?
>
> Thanks,
> Jörn
>
>
>