On Mon, Feb 7, 2011 at 10:26 AM, Ted Yu <[email protected]> wrote:
> About 'number of GC cycles per GC type', is there API to get this
> information ?

As far as I know this is only exposed through JMX.  I'm sure there is
a way to use some horrible APIs in the JDK to "efficiently" access JMX
stuff from the local JVM.  If there's another way than JMX, I'd love
to know.

The way I collect HBase metrics for OpenTSDB is to use the Sun private
API to attach to the JVM and get a JXM URL, even if the VM wasn't
configured to expose any JMX thing on a port.  I think under the hood
it starts a thread in the remote JVM to handle RMI calls that probably
go over the loopback interface.  This is pretty much how jconsole and
friends work, BTW.  Pretty horrible stuff.  :(

-- 
Benoit "tsuna" Sigoure
Software Engineer @ www.StumbleUpon.com

Reply via email to