Buttso Does the BLOG Thing
   Getting down and dirty with OC4J, JMX, Mountain Biking ...

 

Steve Button

Subscribe to "Buttso Does the BLOG Thing" in Radio UserLand.

 

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.

 
 

Reset DMS Metrics


Oracle Application Server uses it's inbuilt DMS (dynamic monitoring service) subsystem to collect and display runtime data for various aspects of the product and applications that it is running.

The metrics are accessible in a number of places in an Oracle Application Server installation -- the Application Server Console, the command line utility dmstool, and the AggreSpy servlet. 

For an OC4J standalone instance, the metrics are also available using the Spy servlet. The Spy servlet is part of the DMS application which is deployed by default into the default web application. The documentation states that

"Spy is a pre-packaged servlet that reports performance metrics for OC4J standalone. Spy reports performance data for an OC4J process. "


To access the Spy servlet, you use a URL of the form http://localhost:8888/dms/Spy -- where the the host:port combination here specify the OC4J instance you want to view the performance stats for.

The basic lifecycle of DMS is that the collection of the runtime data starts when the container is started and stops when the container stops. The default view presented by the Spy servlet is therefore of the data set that has been collected since the OC4J process was first started.

What if you want to view the data on a daily basis for example?  Can you reset the runtime data that has been collected?

Well the answer to that question is yes, if you are using OC4J 10g (9.0.4)

Thanks to one of our DMS developer's here's how you do it.

Resetting DMS Data

To reset the performance data, you send a URL to the Spy servlet to inform it that it should  do a reset.  This basically involves tacking on an "operation=reset" parameter onto a Spy URL.

The basic form of the URL to perform a reset looks likes:

"http://localhost:8888/dms/Spy?operation=reset&name=/name1&recurse=all"

Resetting Metric Names -- Conditions and Explanations

1. The name is a metric name.  An example of a metric name is /JVM/freeMemory.value.  The sensor this metric belongs to will be reset. "recurse=all" or "recurse=children" in the query string have no effects on metric names.

2. The name is a noun name.  An example of a noun name is /JVM or /OC4J/fooServlet, or the root noun /.  You have to include either "recurse=all" or "recurse=children" in the query string.  "recurse=all" resets all sensors contained by the noun and its descendant nouns.   "recurse=children" resets the sensors directly under the noun but not those under its descendant nouns.  DMS will not reset any sensors if you give none of "recurse=all" or "recurse=children" in the query string.

3. You can not use sensor names.

4. You can not give both "recurse=all" and "recurse=children" in the query string.

Resetting Metrics Tables -- Conditions and Explanations


In addition to specify metrics by their names, you can also specify metrics by table names and ask for a reset. 

In this case, the query string becomes:


"http://localhost:8888/dms/Spy?operation=reset&table=table_name1&table=table_name2&recurse=children(recurse=all)"

1. You can use table names as a specifier for a reset.  You also have to include either "recurse=children" or "recurse=all" in the query string.  "recurse=children" will reset all the metrics contained by the tables.  "recurse=all" will reset all the metrics contained by the tables as well as those contained by the tables that is under the specified tables in the table hierarchy.

2. You can use both "name=/noun/metric_name" and "table=table_name" at the same time.



© Copyright 2004 buttso.
Last update: 4/5/2004; 2:32:20 PM.

Click here to visit the Radio UserLand website.