Skip to content

Instantly share code, notes, and snippets.

@brianjriddle
Created September 23, 2011 14:25
Show Gist options
  • Save brianjriddle/1237474 to your computer and use it in GitHub Desktop.
Save brianjriddle/1237474 to your computer and use it in GitHub Desktop.
polopoly mbeans via jruby & jmx4r
jruby-1.6.4 :001 > require 'rubygems'
=> true
jruby-1.6.4 :002 > require 'jmx4r'
=> true
jruby-1.6.4 :003 > JMX::MBean.establish_connection :host => "localhost", :port => 10107
=> #<JMX::MBeanServerConnectionProxy:0x6063f5af @connection=#<#<Class:0x166bb1ead>:0x4c9d22fc>, @connector=#<Java::JavaxManagementRemoteRmi::RMIConnector:0x5ab6b2a5>>
jruby-1.6.4 :004 > polopoly_mbeans = JMX::MBean.find_all_by_name "com.polopoly:*"
=> [#<JMX::MBean:0x2e1ed620>, #<JMX::MBean:0x6a7be687>, #<JMX::MBean:0x6c5bdfae>, #<JMX::MBean:0x3ba5016>, #<JMX::MBean:0x3cdfd643>, #<JMX::MBean:0xb6be7ee>, #<JMX::MBean:0x5947c01d>, #<JMX::MBean:0x7595ddb5>, #<JMX::MBean:0x420ed262>, #<JMX::MBean:0x5b1641cf>, #<JMX::MBean:0x123aabc1>, #<JMX::MBean:0x49e21540>, #<JMX::MBean:0x19e142a5>, #<JMX::MBean:0x13de6be9>, #<JMX::MBean:0x6f7e982f>, #<JMX::MBean:0x60396ed8>, #<JMX::MBean:0x5a9c5842>, #<JMX::MBean:0x4e668387>, #<JMX::MBean:0x75787005>, #<JMX::MBean:0x36029483>, #<JMX::MBean:0x63644028>, #<JMX::MBean:0x4ab03512>, #<JMX::MBean:0x766c570c>, #<JMX::MBean:0x42c71191>, #<JMX::MBean:0x1b5268d7>, #<JMX::MBean:0x3f610944>, #<JMX::MBean:0x7ba76fdd>, #<JMX::MBean:0x2da15597>, #<JMX::MBean:0x3afa43e8>, #<JMX::MBean:0x4805298>, #<JMX::MBean:0x4ae7b77>, #<JMX::MBean:0x5b2bc407>, #<JMX::MBean:0x1652d654>, #<JMX::MBean:0x1875303f>, #<JMX::MBean:0x35b284a4>, #<JMX::MBean:0x5b224686>, #<JMX::MBean:0x27443628>, #<JMX::MBean:0x6f3f903b>, #<JMX::MBean:0x36164a8c>, #<JMX::MBean:0x71784911>, #<JMX::MBean:0x1005354a>, #<JMX::MBean:0x45ed957d>, #<JMX::MBean:0x70f16568>, #<JMX::MBean:0x7838c8c5>, #<JMX::MBean:0x58053b2c>, #<JMX::MBean:0x3f6ff2d9>, #<JMX::MBean:0x4eb0a518>, #<JMX::MBean:0x2f26f304>, #<JMX::MBean:0x261ca3cb>, #<JMX::MBean:0x224577f9>, #<JMX::MBean:0x7ec78e02>, #<JMX::MBean:0x5f3c6654>, #<JMX::MBean:0x766245a4>, #<JMX::MBean:0x2dca4eb4>, #<JMX::MBean:0x3cf522e8>, #<JMX::MBean:0x1c6cc9c>, #<JMX::MBean:0x22a316ad>, #<JMX::MBean:0x125c99f>, #<JMX::MBean:0x57d7e64f>, #<JMX::MBean:0x1f517997>, #<JMX::MBean:0x1e05b891>, #<JMX::MBean:0x99846fd>, #<JMX::MBean:0x6c5c90f6>, #<JMX::MBean:0x31313e0e>, #<JMX::MBean:0x17e1225d>, #<JMX::MBean:0x3d9713ea>, #<JMX::MBean:0x99c873d>, #<JMX::MBean:0x372bab9>, #<JMX::MBean:0x6140c973>, #<JMX::MBean:0x6469cee6>, #<JMX::MBean:0x5e8e918a>, #<JMX::MBean:0x61f52b85>, #<JMX::MBean:0x26fc5b01>, #<JMX::MBean:0x1bab2a6>, #<JMX::MBean:0x826b12d>]
jruby-1.6.4 :005 > polopoly_mbeans.each do |mbean|
jruby-1.6.4 :006 > puts mbean.object_name["name"]
jruby-1.6.4 :007?> end
Content data memory statistics
ModuleContainer
Content data memory statistics
ContentService.allmethods
ModuleContainerDescription
ModuleContainerDescription
External id memory lookup statistics
LegacyService.allmethods
WorkflowService.allmethods
jmsserver
LockService.methods
tv4xmlserver
ClientCMServerServiceWrapper
LockService.allmethods
SearchService.allmethods
LegacyService.methods
Change list listener statistics
SearchService.methods
WorkflowService.methods
ModuleContainer
Content cache
FileService.methods
ModuleContainerReconnector
Settings
FileService.methods
eventexceptionhandler_eventdispatcher_polopolyclient_polopoly-thinclient
MajorService.methods
ModuleContainer
External id memory lookup statistics
Content cache control
CachingUserServer
ContentService.methods
SystemInfo
MajorService.allmethods
LockService.allmethods
EventDispatcher
Content cache
LockService.methods
SearchService.methods
MajorService.allmethods
ModuleContainer
Content cache control
LegacyService.methods
LegacyService.allmethods
Content id memory lookup statistics
BatchService.methods
ModuleContainerDescription
ModuleControl
ModuleControl
ModuleContainer
Major info memory statistics
Settings
SearchService.allmethods
BatchService.allmethods
ContentService.methods
Content id memory lookup statistics
ModuleControl
FileService.allmethods
FileService.allmethods
Change list listener statistics
ModuleControl
ModuleControl
Major info memory statistics
PolicyCMServer
WorkflowService.methods
ModuleContainerDescription
ModuleControl
BatchService.methods
ContentService.allmethods
Lock info memory statistics
MajorService.methods
Lock info memory statistics
ModuleContainerDescription
WorkflowService.allmethods
BatchService.allmethods
=> [#<JMX::MBean:0x2e1ed620>, #<JMX::MBean:0x6a7be687>, #<JMX::MBean:0x6c5bdfae>, #<JMX::MBean:0x3ba5016>, #<JMX::MBean:0x3cdfd643>, #<JMX::MBean:0xb6be7ee>, #<JMX::MBean:0x5947c01d>, #<JMX::MBean:0x7595ddb5>, #<JMX::MBean:0x420ed262>, #<JMX::MBean:0x5b1641cf>, #<JMX::MBean:0x123aabc1>, #<JMX::MBean:0x49e21540>, #<JMX::MBean:0x19e142a5>, #<JMX::MBean:0x13de6be9>, #<JMX::MBean:0x6f7e982f>, #<JMX::MBean:0x60396ed8>, #<JMX::MBean:0x5a9c5842>, #<JMX::MBean:0x4e668387>, #<JMX::MBean:0x75787005>, #<JMX::MBean:0x36029483>, #<JMX::MBean:0x63644028>, #<JMX::MBean:0x4ab03512>, #<JMX::MBean:0x766c570c>, #<JMX::MBean:0x42c71191>, #<JMX::MBean:0x1b5268d7>, #<JMX::MBean:0x3f610944>, #<JMX::MBean:0x7ba76fdd>, #<JMX::MBean:0x2da15597>, #<JMX::MBean:0x3afa43e8>, #<JMX::MBean:0x4805298>, #<JMX::MBean:0x4ae7b77>, #<JMX::MBean:0x5b2bc407>, #<JMX::MBean:0x1652d654>, #<JMX::MBean:0x1875303f>, #<JMX::MBean:0x35b284a4>, #<JMX::MBean:0x5b224686>, #<JMX::MBean:0x27443628>, #<JMX::MBean:0x6f3f903b>, #<JMX::MBean:0x36164a8c>, #<JMX::MBean:0x71784911>, #<JMX::MBean:0x1005354a>, #<JMX::MBean:0x45ed957d>, #<JMX::MBean:0x70f16568>, #<JMX::MBean:0x7838c8c5>, #<JMX::MBean:0x58053b2c>, #<JMX::MBean:0x3f6ff2d9>, #<JMX::MBean:0x4eb0a518>, #<JMX::MBean:0x2f26f304>, #<JMX::MBean:0x261ca3cb>, #<JMX::MBean:0x224577f9>, #<JMX::MBean:0x7ec78e02>, #<JMX::MBean:0x5f3c6654>, #<JMX::MBean:0x766245a4>, #<JMX::MBean:0x2dca4eb4>, #<JMX::MBean:0x3cf522e8>, #<JMX::MBean:0x1c6cc9c>, #<JMX::MBean:0x22a316ad>, #<JMX::MBean:0x125c99f>, #<JMX::MBean:0x57d7e64f>, #<JMX::MBean:0x1f517997>, #<JMX::MBean:0x1e05b891>, #<JMX::MBean:0x99846fd>, #<JMX::MBean:0x6c5c90f6>, #<JMX::MBean:0x31313e0e>, #<JMX::MBean:0x17e1225d>, #<JMX::MBean:0x3d9713ea>, #<JMX::MBean:0x99c873d>, #<JMX::MBean:0x372bab9>, #<JMX::MBean:0x6140c973>, #<JMX::MBean:0x6469cee6>, #<JMX::MBean:0x5e8e918a>, #<JMX::MBean:0x61f52b85>, #<JMX::MBean:0x26fc5b01>, #<JMX::MBean:0x1bab2a6>, #<JMX::MBean:0x826b12d>]
jruby-1.6.4 :008 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment