Chapter 4. JMX Integration

Table of Contents

Beet Administrative MBeans
Beet Statistical MBeans

Beet offers two major JMX features: Beet Administrative MBeans for admininistering beet itself, and Beet Statistical MBeans for monitoring the performance of your application.

Beet Administrative MBeans

To enable JMX administration of beet, add the register-mbeans attribute to your <bt:manager> tag:

Example 4.1. Activating Beet Administration MBeans

<bt:manager id="myManager"1
            application="myapp"2
            register-mbeans="true"3
            track-method-expression="execution(* com.mtgi.analytics..*Tracked(..))"/>

1

The id value will be used as the group name in registered MBeans. If you don't specify an id, the default value defaultTrackingManager is used.

2

The required application value will be used as the domain name in registered MBeans.

2

"true" enables mbean registration. This optional attribute is false by default.


Following the example above, an MBean named testApp:package=com.mtgi.analytics,group=myManager,name=BeetManager will be registered with the platform JMX server. This MBean defines the following attributes and operations:

BeetManager MBean Features
NameTypeDescription
ApplicationattributeThe application name recorded with all events originating in this manager. This should be the same value as the domain name of the MBean.
SuspendedattributeTrue if this manager is suspended, false otherwise (see "suspend" and "resume" operations).
EventsPendingFlushattributeThe number of events which have been recorded but not yet flushed to the persisters. See the "flush" operation.
flushoperationFlush all completed events to the persisters. This is normally done automatically according to the flush interval (default 5 minutes) or when the flush threshold is exceeded (default 100 events), whichever comes first. Manual flush is useful if you don't want to wait until the next natural flush to analyze event data. The EventsPendingFlush attribute value will tell you how many events have been recorded but not yet flushed to the persisters.
suspendoperationSuspend recording of events. No events captured while suspect will be persisted.
resumeoperationResume recording of events if suspended. If not suspended, this operation has no effect.

If you are using <bt:xml-persister> (the default), another MBean called BeetLog is also registered for log control. Following the example above, this MBean will be named testApp:package=com.mtgi.analytics,group=myManager,name=BeetLog. BeetLog supports the following attributes and operations:

BeetLog MBean Features
NameTypeDescription
Binaryattribute

If true, binary XML (FastInfoSet) data is written to the log file. If false, plain UTF-8 text XML is written. Binary XML is recommended for production systems; see the section called “Log Analysis” for information on manipulating binary XML log data.

Changes to the value of this attribute only take affect after the next log rotation.

Compressattribute

If true, log file data is GZIP compressed. Compression can be enabled separately or in combination with Binary logging. Compressed logging is recommended for production systems.

Changes to the value of this attribute only take affect after the next log rotation.

FileSizeattributeThe length, in bytes, of the active log file.
rotateLogoperationForce a log rotation. This operation is normally performed automatically, every day at midnight by default. The return value is the absolute path to the newly created log archive file. If you manually rotate a log file, it will probably be useful to first execute the flush operation on the BeetManager MBean to make sure all of the event data in memory has been flush.

Beet Administrative MBeans

JConsole 6 with Beet MBeans