Caucho Technology
  • resin 4.0
  • health meters


    Health meters are a simple way to create visually pleasing graphs in /resin-admin.

    Configuration

    health.xml

    Meters are configured as part of health.xml using CanDI to create and update Java objects. Refer to health checking configuration for a full description of health.xml. Resin 4.0.17 and later includes a full compliemnt of pre-configured JMX meters in health.xml.

    Example: importing health.xml into resin.xml
    <resin xmlns="http://caucho.com/ns/resin"
           xmlns:resin="urn:java:com.caucho.resin">
      <cluster-default>  
        ...
        <!--
           - Admin services
          -->
        <resin:DeployService/>
        
        <resin:if test="${resin.professional}">
          <resin:AdminServices/>
        </resin:if>
    
        <!--
           - Configuration for the health monitoring system
          -->
        <resin:if test="${resin.professional}">
          <resin:import path="${__DIR__}/health.xml" optional="true"/>
        </resin:if>
        ...
      </cluster-default>
    </resin>
    

    Note: <resin:AdminServices/> (or more precisely just <resin:StatsService/>) is required to support health meters and graphing.

    Meter names

    Health meters are named using a concatenation of keys separated by pipe (|) characters, loosely organized from least specific to most specific. Since meter statistics are shared between each member in a Resin cluster, Resin will automatically prefix each meter name with the cluster node index to insure the name is unique between cluster members.

    The pipe character in the name provides a secondary benefit of helping to enhance the /resin-admin UI by categorizing meters into drill downs. Consider the following example.

    Example: meter naming
    <cluster xmlns="http://caucho.com/ns/resin"
             xmlns:resin="urn:java:com.caucho.resin"
             xmlns:health="urn:java:com.caucho.health"
             xmlns:ee="urn:java:ee">
    
      <health:JmxDeltaMeter>
        <name>JVM|Compilation|Compilation Time</name>
        <object-name>java.lang:type=Compilation</object-name>
        <attribute>TotalCompilationTime</attribute>
      </health:JmxDeltaMeter>
    
    </cluster>
    

    In this example, JVM|Compilation|Compilation Time provides the base of the name. For cluster node index 0, Resin prefixes the name with 00|. /resin-admin will then use the cluster index and first two keys to create drill downs to logically organized meters for display.

    JMX meters

    Virtually any local numeric JMX MBean attribute can be graphed using JMX meters.

    <health:JmxMeter>

    child of cluster

    Creates a meter that graphs the current value of a numeric JMX MBean attribute.

    <health:JmxMeter> Attributes
    ATTRIBUTEDESCRIPTIONTYPEDEFAULT
    nameThe name of the meter to display in /resin-admin (see meter names)StringN/A
    objectNameThe JMX MBean nameStringN/A
    attributeThe MBean attribute to sampleStringN/A
    Example: <health:JmxMeter> in health.xml
    <cluster xmlns="http://caucho.com/ns/resin"
             xmlns:resin="urn:java:com.caucho.resin"
             xmlns:health="urn:java:com.caucho.health"
             xmlns:ee="urn:java:ee">
    
      <health:JmxMeter>
        <name>OS|Memory|Physical Memory Free</name>
        <object-name>java.lang:type=OperatingSystem</object-name>
        <attribute>FreePhysicalMemorySize</attribute>
      </health:JmxMeter>
    
    </cluster>
    

    <health:JmxDeltaMeter>

    child of cluster

    Creates a meter that graphs the difference between the current and previous values of a numeric JMX MBean attribute.

    <health:JmxDeltaMeter> Attributes
    ATTRIBUTEDESCRIPTIONTYPEDEFAULT
    nameThe name of the meter to display in /resin-admin (see meter names)StringN/A
    objectNameThe JMX MBean nameStringN/A
    attributeThe MBean attribute to sampleStringN/A
    Example: <health:JmxDeltaMeter> in health.xml
    <cluster xmlns="http://caucho.com/ns/resin"
             xmlns:resin="urn:java:com.caucho.resin"
             xmlns:health="urn:java:com.caucho.health"
             xmlns:ee="urn:java:ee">
    
      <health:JmxDeltaMeter>
        <name>JVM|Compilation|Compilation Time</name>
        <object-name>java.lang:type=Compilation</object-name>
        <attribute>TotalCompilationTime</attribute>
      </health:JmxDeltaMeter>
    
    </cluster>
    

    Copyright © 1998-2011 Caucho Technology, Inc. All rights reserved.
    Resin ® is a registered trademark, and Quercustm, Ambertm, and Hessiantm are trademarks of Caucho Technology.