Miles to go …

September 22, 2009

TOTD #105: GlassFish v3 Monitoring – How to monitor a Rails app using asadmin, JavaScript, jConsole, REST ?

Filed under: glassfish, rails, totd — arungupta @ 11:30 pm

Monitoring infrastructure in GlassFish v3 is getting an extreme makeover. Prashanth defines it very nicely in his detailed introduction:

We provide a way to dynamically and non-intrusively generate monitoring events from any of the GlassFish runtime classes, the ability to listen to these events, collect the statistics and expose these statistics through various standard clients.

 The "dynamic" nature indicates that monitoring can be turned ON or OFF in a GlassFish instance running in production environment. It also means the granularity to which the monitoring information can be generated. This information can be generated for not only a traditional Java EE applications, but Rails, Django and other type of applications that can be easily deployed on GlassFish v3. And that is extensible for other pluggable containers too. The data can be accessed using multiple mechanisms providing the administrator a wide variety of choice for tools, e.g. DTrace, JMX, REST, asadmin CLI, and Admin Console and thus another point in favor of "dynamic".

The "non-intrusive" behavior means that monitoring can be used in production environment with minimal overhead. It also means that there is no overhead when monitoring is not enabled. Anyway, monitoring needs to be explicitly enabled as explained below.

As mentioned above, there are multiple ways to access the monitoring data. The different ways to access the monitoring data are:

  1. DTrace scripts (only on Solaris)
  2. asadmin CLI
  3. Admin Console
  4. JMX/jConsole
  5. REST
  6. Custom client using a 3rd party scripting language (available as value-add feature to paid customers only)

This Tip Of The Day will describe how to access the monitoring data using asadmin CLI and a JavaScript client. Note that the JavaScript client feature is available as a value-add to the community version of GlassFish and available only to the paid customers.

This tip will use a pre-deployed Rails application as (Redmine as described in TOTD #104) on a nightly GlassFish v3 build (CI, nightly, or promoted) and explains how to monitor this application.

Using the terminology defined in Monitoring in GlassFish v3 blog, the JRuby subsystem in GlassFish has multiple probe providers and each provider has multiple probes. The JRuby subsystem also provides multiple stats providers with probe listeners. All of these elements are linked using the monitoring infrastructure in GlassFish.

Lets monitor our Rails application

Monitoring using asadmin CLI

By default the monitoring is turned OFF for all the components. Lets enable monitoring for the JRuby container as:

asadmin enable-monitoring --level jruby-container=HIGH

The other possible values are "LOW" and "OFF". All the probes publishing monitoring data can be listed as:

~/tools/glassfish/v3/9-18/glassfishv3 >./bin/asadmin list --monitor=true "*"
server
server.containers
server.containers.jruby
server.containers.jruby.applications
server.containers.jruby.http
server.containers.jruby.http.redmine-0.8.5
server.containers.jruby.runtime-pool
server.containers.jruby.runtime-pool.redmine-0.8.5

Command list executed successfully.

A snapshot of the monitoring data can be obtained as:

~/tools/glassfish/v3/9-18/glassfishv3 >./bin/asadmin get --monitor=true "*jruby*"
server.containers.jruby.applications.activerubyapplications.redmine-0.8.5-appName = redmine-0.8.5
server.containers.jruby.applications.activerubyapplications.redmine-0.8.5-description =
 server.containers.jruby.applications.activerubyapplications.redmine-0.8.5-environment = development
server.containers.jruby.applications.activerubyapplications.redmine-0.8.5-jrubyVersion = 1.3.0
server.containers.jruby.applications.activerubyapplications.redmine-0.8.5-lastsampletime = 1253322280437
server.containers.jruby.applications.activerubyapplications.redmine-0.8.5-name = redmine-0.8.5
server.containers.jruby.applications.activerubyapplications.redmine-0.8.5-rubyFramework = rails
server.containers.jruby.applications.activerubyapplications.redmine-0.8.5-starttime = 1253322280437
server.containers.jruby.applications.activerubyapplications.redmine-0.8.5-unit =
server.containers.jruby.applications.activerubyappscount-count = 1
server.containers.jruby.applications.activerubyappscount-description = Number of currently loaded Ruby applications
server.containers.jruby.applications.activerubyappscount-lastsampletime = 1253322279921
server.containers.jruby.applications.activerubyappscount-name = ActiveRubyApplications
server.containers.jruby.applications.activerubyappscount-starttime = 1253322279922
server.containers.jruby.applications.activerubyappscount-unit = count
server.containers.jruby.http.redmine-0.8.5.address = null
server.containers.jruby.http.redmine-0.8.5.averageprocessingtime = 0
server.containers.jruby.http.redmine-0.8.5.count200-count = 0
server.containers.jruby.http.redmine-0.8.5.count200-description = Number of responses with a status code equal to 200
server.containers.jruby.http.redmine-0.8.5.count200-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count200-name = Count200
server.containers.jruby.http.redmine-0.8.5.count200-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count200-unit = count
server.containers.jruby.http.redmine-0.8.5.count2xx-count = 0
server.containers.jruby.http.redmine-0.8.5.count2xx-description = Number of responses with a status code in the 2xx range
server.containers.jruby.http.redmine-0.8.5.count2xx-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count2xx-name = Count2xx
server.containers.jruby.http.redmine-0.8.5.count2xx-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count2xx-unit = count
server.containers.jruby.http.redmine-0.8.5.count302-count = 0
server.containers.jruby.http.redmine-0.8.5.count302-description = Number of responses with a status code equal to 302
server.containers.jruby.http.redmine-0.8.5.count302-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count302-name = Count302
server.containers.jruby.http.redmine-0.8.5.count302-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count302-unit = count
server.containers.jruby.http.redmine-0.8.5.count304-count = 0
server.containers.jruby.http.redmine-0.8.5.count304-description = Number of responses with a status code equal to 304
server.containers.jruby.http.redmine-0.8.5.count304-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count304-name = Count304
server.containers.jruby.http.redmine-0.8.5.count304-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count304-unit = count
server.containers.jruby.http.redmine-0.8.5.count3xx-count = 0
server.containers.jruby.http.redmine-0.8.5.count3xx-description = Number of responses with a status code in the 3xx range
server.containers.jruby.http.redmine-0.8.5.count3xx-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count3xx-name = Count3xx
server.containers.jruby.http.redmine-0.8.5.count3xx-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count3xx-unit = count
server.containers.jruby.http.redmine-0.8.5.count400-count = 0
server.containers.jruby.http.redmine-0.8.5.count400-description = Number of responses with a status code equal to 400
server.containers.jruby.http.redmine-0.8.5.count400-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count400-name = Count400
server.containers.jruby.http.redmine-0.8.5.count400-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count400-unit = count
server.containers.jruby.http.redmine-0.8.5.count401-count = 0
server.containers.jruby.http.redmine-0.8.5.count401-description = Number of responses with a status code equal to 401
server.containers.jruby.http.redmine-0.8.5.count401-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count401-name = Count401
server.containers.jruby.http.redmine-0.8.5.count401-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count401-unit = count
server.containers.jruby.http.redmine-0.8.5.count403-count = 0
server.containers.jruby.http.redmine-0.8.5.count403-description = Number of responses with a status code equal to 403
server.containers.jruby.http.redmine-0.8.5.count403-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count403-name = Count403
server.containers.jruby.http.redmine-0.8.5.count403-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count403-unit = count
server.containers.jruby.http.redmine-0.8.5.count404-count = 0
server.containers.jruby.http.redmine-0.8.5.count404-description = Number of responses with a status code equal to 404
server.containers.jruby.http.redmine-0.8.5.count404-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count404-name = Count404
server.containers.jruby.http.redmine-0.8.5.count404-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count404-unit = count
server.containers.jruby.http.redmine-0.8.5.count4xx-count = 0
server.containers.jruby.http.redmine-0.8.5.count4xx-description = Number of responses with a status code in the 4xx range
server.containers.jruby.http.redmine-0.8.5.count4xx-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count4xx-name = Count4xx
server.containers.jruby.http.redmine-0.8.5.count4xx-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count4xx-unit = count
server.containers.jruby.http.redmine-0.8.5.count503-count = 0
server.containers.jruby.http.redmine-0.8.5.count503-description = Number of responses with a status code equal to 503
server.containers.jruby.http.redmine-0.8.5.count503-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count503-name = Count503
server.containers.jruby.http.redmine-0.8.5.count503-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count503-unit = count
server.containers.jruby.http.redmine-0.8.5.count5xx-count = 0
server.containers.jruby.http.redmine-0.8.5.count5xx-description = Number of responses with a status code in the 5xx range
server.containers.jruby.http.redmine-0.8.5.count5xx-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count5xx-name = Count5xx
server.containers.jruby.http.redmine-0.8.5.count5xx-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.count5xx-unit = count
server.containers.jruby.http.redmine-0.8.5.countother-count = 0
server.containers.jruby.http.redmine-0.8.5.countother-description = Number of responses with other status codes
server.containers.jruby.http.redmine-0.8.5.countother-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.countother-name = CountOther
server.containers.jruby.http.redmine-0.8.5.countother-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.countother-unit = count
server.containers.jruby.http.redmine-0.8.5.errorcount-count = 0
server.containers.jruby.http.redmine-0.8.5.errorcount-description = Number of responses with a status code greater than 400
server.containers.jruby.http.redmine-0.8.5.errorcount-lastsampletime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.errorcount-name = ErrorCount
server.containers.jruby.http.redmine-0.8.5.errorcount-starttime = 1253322280245
server.containers.jruby.http.redmine-0.8.5.errorcount-unit = count
server.containers.jruby.http.redmine-0.8.5.requestcount-count = 0
server.containers.jruby.http.redmine-0.8.5.requestcount-description = Number of HTTP requests received
server.containers.jruby.http.redmine-0.8.5.requestcount-lastsampletime = 1253322280243
server.containers.jruby.http.redmine-0.8.5.requestcount-name = RequestCounter
server.containers.jruby.http.redmine-0.8.5.requestcount-starttime = 1253322280243
server.containers.jruby.http.redmine-0.8.5.requestcount-unit = count
server.containers.jruby.http.redmine-0.8.5.requestpersecond = null
server.containers.jruby.runtime-pool.redmine-0.8.5.activeruntimes-count = 1
server.containers.jruby.runtime-pool.redmine-0.8.5.activeruntimes-description = Currently active runtimes
server.containers.jruby.runtime-pool.redmine-0.8.5.activeruntimes-lastsampletime = 1253322280241
server.containers.jruby.runtime-pool.redmine-0.8.5.activeruntimes-name = activeRuntimes
server.containers.jruby.runtime-pool.redmine-0.8.5.activeruntimes-starttime = 1253322280241
server.containers.jruby.runtime-pool.redmine-0.8.5.activeruntimes-unit = count
server.containers.jruby.runtime-pool.redmine-0.8.5.applicationname = redmine-0.8.5
server.containers.jruby.runtime-pool.redmine-0.8.5.contextpath = /redmine-0.8.5
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmaximum-count = 1
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmaximum-description = Maximum active runtimes
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmaximum-lastsampletime = 1253322280241
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmaximum-name = hardMaximum
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmaximum-starttime = 1253322280241
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmaximum-unit = count
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmminimum-count = 1
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmminimum-description = Minimum active runtimes
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmminimum-lastsampletime = 1253322280241
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmminimum-name = hardMinimum
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmminimum-starttime = 1253322280241
server.containers.jruby.runtime-pool.redmine-0.8.5.hardmminimum-unit = count

Command get executed successfully.

The command asadmin get --monitor=true "*jruby*" dumps a snapshot of the monitoring data such as the number of Ruby currently applications loaded, application name, JRuby version, environment (development / test / production), currently active runtimes, min/max runtimes, number of HTTP requests / responses with a certain HTTP code and much more information. It basically dumps all the JRuby monitoring information captured so far.

An alternate regular expression may be specified such as:

asadmin get --monitor=true "*jruby*runtime-pool*"

to gather only the runtime pool specific values.

Monitoring using JavaScript client

Third-party scripting client are a value-add to the community versions. Just like Enterprise Manager, the value-add will be available as a patch to the users who purchase commercial support. Lets see what can be done with it though.

First of all you can type the command "list-probes" to see a list of all the probes that are available. A typical output will look like:

~/tools/glassfish/v3/9-18/glassfishv3 >./bin/asadmin list-probes
glassfish:kernel:connections-keep-alive:decrementCountConnectionsEvent decrementCountConnectionsEvent(java.lang.String)
glassfish:web:web-module:webModuleStoppedEvent webModuleStoppedEvent(java.lang.String, java.lang.String)
glassfish:jca:connection-pool:connectionValidationFailedEvent connectionValidationFailedEvent(java.lang.String, int)
glassfish:jca:work-management:workWaitedFor workWaitedFor(java.lang.String, long)
glassfish:jdbc:connection-pool:connectionTimedOutEvent connectionTimedOutEvent(java.lang.String)
glassfish:security:ejbpolicy:ejbPCCreationEvent ejbPCCreationEvent(java.lang.String)
glassfish:kernel:thread-pool:threadReturnedToPoolEvent threadReturnedToPoolEvent(java.lang.String, java.lang.String)
glassfish:web:session:sessionPersistedEndEvent sessionPersistedEndEvent(java.lang.String, java.lang.String, java.lang.String)
glassfish:web:http-service:requestStartEvent requestStartEvent(java.lang.String, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String)
glassfish:jdbc:connection-pool:connectionsFreedEvent connectionsFreedEvent(java.lang.String, int)
glassfish:jdbc:connection-pool:toString toString(java.lang.String, java.lang.StringBuffer)
glassfish:jca:connection-pool:decrementFreeConnectionsSizeEvent decrementFreeConnectionsSizeEvent(java.lang.String, int)
glassfish:kernel:connections-keep-alive:incrementCountFlushesEvent incrementCountFlushesEvent(java.lang.String)
glassfish:webservices:109:deploy deploy(com.sun.enterprise.deployment.Application, com.sun.enterprise.deployment.WebServiceEndpoint)
glassfish:jca:connection-pool:connectionAcquiredEvent connectionAcquiredEvent(java.lang.String)
glassfish:web:http-service:requestEndEvent requestEndEvent(java.lang.String, java.lang.String, java.lang.String, int, java.lang.String, java.lang.String, int)
glassfish:kernel:connections-keep-alive:incrementCountRefusalsEvent incrementCountRefusalsEvent(java.lang.String)
glassfish:kernel:connections:connectionConnectedEvent connectionConnectedEvent(java.lang.String, int)
glassfish:kernel:file-cache:addHeapSizeEvent addHeapSizeEvent(java.lang.String, long)
glassfish:jruby:runtime-pool:runtimePoolUpdateEvent runtimePoolUpdateEvent(java.lang.String, int, int, int, int, int)
glassfish:security:web:securityManagerCreationEvent securityManagerCreationEvent(java.lang.String)
glassfish:security:web:securityManagerDestructionEvent securityManagerDestructionEvent(java.lang.String)
glassfish:webservices:ri:undeploy undeploy(com.sun.xml.ws.transport.http.servlet.ServletAdapter)
glassfish:web:session:sessionPersistedStartEvent sessionPersistedStartEvent(java.lang.String, java.lang.String, java.lang.String)
glassfish:ejb:pool:objectAddedEvent ejbObjectAddedEvent()
glassfish:ejb:bean:methodStartEvent ejbMethodStartEvent(java.lang.String, java.lang.String, java.lang.String, java.lang.reflect.Method)
glassfish:jdbc:connection-pool:connectionRequestServedEvent connectionRequestServedEvent(java.lang.String, long)

All the JRuby probes can be easily listed as:

~/tools/glassfish/v3/9-18/glassfishv3 >./bin/asadmin list-probes | grep jruby
glassfish:jruby:runtime-pool:runtimePoolUpdateEvent runtimePoolUpdateEvent(java.lang.String, int, int, int, int, int)
glassfish:jruby:http:requestStartEvent requestStartEvent(java.lang.String, java.lang.String, int)
glassfish:jruby:jruby-container:jrubyModuleStartedEvent jrubyModuleStartedEvent(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
glassfish:jruby:jruby-container:jrubyModuleStoppedEvent jrubyModuleStoppedEvent(java.lang.String, java.lang.String, java.lang.String)
glassfish:jruby:http:requestEndEvent requestEndEvent(java.lang.String, int)
glassfish:jruby:runtime-pool:runtimePoolStartEvent runtimePoolStartEvent(java.lang.String, int, int, int, int, int, int, int)

More detailed information about each probe can be easily found by giving the command:

~/tools/glassfish/v3/9-18/glassfishv3 >./bin/asadmin list-probes --manpage=true glassfish:jruby:runtime-pool:runtimePoolUpdateEvent

This will show the detailed information ("man" pages) about the specific probe. A JavaScript client to monitor the deployed Rails application and gather the relevant statistics can be written using these pages as shown below:

moduleStarted = function(appName, appType, env, jruby) {
    client.print( '\n log> Deployed a \'' + appType + '\' app named \'' + appName + '\' in \'' + env + '\' environment with JRuby \'' + jruby + '\'.');
}

moduleStopped = function(appName, appType, env) {
    client.print( '\n log> Undeployed a \'' + appType + '\' app named \'' + appName + '\' in \'' + env + '\' environment.');
}

requestStarted = function(contextPath, serverName, port) {
    client.print( '\n log> Request started at \'' + contextPath + '\' hosted on \'' + serverName + ':' + port + '\'');
}

requestEnded = function(contextPath, statusCode) {
    client.print( '\n log> Request stopped at \'' + contextPath + '\' with status code \'' + statusCode + '\'');
}

runtimePoolStart = function(appName, activeRuntimes, queueSize) {
   client.print( '\n log> JRuby runtime pool started for the app \'' + appName + '\': active runtime - ' + activeRuntimes + ', queue size - ' + queueSize);
}

runtimePoolUpdate = function(appName, activeRuntimes, queueSize) {
   client.print( '\n log> JRuby runtime pool updated for the app \'' + appName + '\': active runtime - ' + activeRuntimes + ', queue size - ' + queueSize);
}

moduleStartedParams = java.lang.reflect.Array.newInstance(java.lang.String, 4);
moduleStartedParams[0]="appName";
moduleStartedParams[1]="applicationType";
moduleStartedParams[2]="environment";
moduleStartedParams[3]="jrubyVersion";
scriptContainer.registerListener('glassfish:jruby:jruby-container:jrubyModuleStartedEvent', moduleStartedParams, 'moduleStarted');

moduleStoppedParams = java.lang.reflect.Array.newInstance(java.lang.String, 3);
moduleStoppedParams[0]="appName";
moduleStoppedParams[1]="applicationType";
moduleStoppedParams[2]="environment";
scriptContainer.registerListener('glassfish:jruby:jruby-container:jrubyModuleStoppedEvent', moduleStoppedParams, 'moduleStopped');

requestStartParams = java.lang.reflect.Array.newInstance(java.lang.String, 3);
requestStartParams[0]="contextPath";
requestStartParams[1]="serverName";
requestStartParams[2]="port";
scriptContainer.registerListener('glassfish:jruby:http:requestStartEvent', requestStartParams, 'requestStarted');

requestEndParams = java.lang.reflect.Array.newInstance(java.lang.String, 2);
requestEndParams[0]="contextPath";
requestEndParams[1]="statusCode";
scriptContainer.registerListener('glassfish:jruby:http:requestEndEvent', requestEndParams, 'requestEnded');

runtimePoolParams = java.lang.reflect.Array.newInstance(java.lang.String, 3);
runtimePoolParams[0]="appName";
runtimePoolParams[1]="activeRuntimes";
runtimePoolParams[2]="queueSize";
scriptContainer.registerListener('glassfish:jruby:runtime-pool:runtimePoolStartEvent', runtimePoolParams, 'runtimePoolStart');
scriptContainer.registerListener('glassfish:jruby:runtime-pool:runtimePoolUpdateEvent', runtimePoolParams, 'runtimePoolUpdate');

This script register listeners for different probe events, pass a set of parameters that need to be captured, and print the information in a callback method specified during registration. The number of listeners and parameters / listener may be altered to meet your data capturing needs.

This script is stored in a file "monitor-rails.js" and used as described below. As a Rails application is deployed, requests invoked, and undeployed, the following messages are printed on the console:

~/tools/glassfish/v3/9-18/glassfishv3 >./bin/asadmin run-script monitor-rails.js


 log> Deployed a 'rails' app named 'redmine-0.8.5' in 'development' environment with JRuby '1.3.0'.
 log> JRuby runtime pool started for the app 'redmine-0.8.5': active runtime - 1, queue size - 0
 log> Request started at '/redmine-0.8.5' hosted on 'localhost:8080'
 log> Request stopped at '/redmine-0.8.5' with status code '200'
 log> Request started at '/redmine-0.8.5' hosted on 'localhost:8080'
 log> Request stopped at '/redmine-0.8.5' with status code '200'
 log> Undeployed a 'rails' app named 'redmine-0.8.5' in 'development' environment.

Note "run-script" is the command that comes as part of the value-add. As described earlier, a snapshot of the monitoring information can be easily captured using asadmin as:

~/tools/glassfish/v3/9-18/glassfishv3 >./bin/asadmin get --monitor=true "*jruby*request*"
server.containers.jruby.http.redmine-0.8.5.requestcount-count = 2
server.containers.jruby.http.redmine-0.8.5.requestcount-description = Number of HTTP requests received
server.containers.jruby.http.redmine-0.8.5.requestcount-lastsampletime = 1253638362651
server.containers.jruby.http.redmine-0.8.5.requestcount-name = RequestCounter
server.containers.jruby.http.redmine-0.8.5.requestcount-starttime = 1253638362651
server.containers.jruby.http.redmine-0.8.5.requestcount-unit = count
server.containers.jruby.http.redmine-0.8.5.requestpersecond = 1

Command get executed successfully.

As you can see, the total number of requests is shown as "2".

Just for fun, I ran Apache ab with 20 requests and 4 concurrency ("-n 20 -c 4") on "http://localhost:8080/redmine-0.8.5" and saw the following results:

Monitoring OFF
(default)
Monitoring=HIGH
(no data printed)
Monitoring=HIGH
(data printed)
Time taken for requests (secs) 26.231 26.997 26.665
Requests per second 0.76 0.74 0.75
Time per request (ms) 1311.574 1349.859 1333.239

The server was restarted between each run. These numbers were generated on my development machine so they are most likely skewed. But as a development benchmark the numbers do indicate that GlassFish v3 monitoring is truly non-intrusive. The total time taken for requests, requests/second, and time/request is pretty much identical.

Future blogs will cover how to access this data using web-based DTrace scripts, web-based Admin Console, jConsole, and REST interface.

A complete archive of all the tips is available here.

Technorati: totd glassfish v3 monitoring asadmin javascript jruby rails redmine

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • StumbleUpon
  • Technorati
  • Twitter
  • Slashdot
Related posts:
  1. TOTD #96: GlassFish v3 REST Interface to Monitoring and Management – JSON, XML, and HTML representations
  2. TOTD #113: JavaFX front-end for GlassFish v3 Administration – Using REST interface
  3. TOTD #61: How to locally manage/monitor your Rails/Merb applications on JRuby/GlassFish using JMX ?
  4. TOTD #118: Managing OSGi bundles in GlassFish v3 – asadmin, filesystem, telnet console, web browser, REST
  5. TOTD #62: How to remotely manage/monitor your Rails/Merb applications on JRuby/GlassFish using JMX API ?

3 Comments »

  1. Interesting – especially the Javascript probes ; looks like cross-platform DTrace (with a slightly less loopy syntax).

    Think I’ll be bashing on this as part of this years FishCAT; thanks for the quickstart :)

    Comment by Dick Davies — September 26, 2009 @ 5:56 am

  2. [...] TOTD #105: Monitor Rails application using JavaScript [...]

    Pingback by TOTD #110: JRuby on Rails application using Oracle on GlassFish « Miles to go … — October 6, 2009 @ 12:24 pm

  3. [...] time on the Java EE 6 booth talking about the technology and showcasing GlassFish features such as monitoring and Rails [...]

    Pingback by Oracle Open World 2009 – Day 3 Report « Miles to go … — October 16, 2009 @ 10:15 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

The views expressed on this blog are my own and do not necessarily reflect the views of Oracle.
Powered by WordPress