Ruby-Idiomatic Library (in JRuby) to access a Java JMX Interface
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
MIT-LICENSE
README.rdoc
VERSION

README.rdoc

RubyJmx

This is a JRuby library which gives the user easy access to the JMX interface provided by various Java App Servers.

It's primary use case is to monitor services very easily (for memory, CPU, threads, etc)

Acknowledgements

The inspiration came from Jeff Mesnil's blog post: jmesnil.net/weblog/2007/03/23/jmx-scripts-using-jruby/

Status

As of now, you can only query the heap status from JMX. More features will be added (Patches and pull requests always welcome)

Usage

The lib can be used like so:

require 'lib/rubyjmx'

RubyJMX::Session.new('localhost', '3000',
                      :username => 'username',
                      :password => 'password', 
                      :connect => true) do |session|
  # Prints out in bytes, the number of used bytes in the JVM heap
  puts session.heap_memory_snapshot.used
end