Assign each counter statistic an OID suffix, which forms part of the OID registered for the statistic. The OID suffix is used to differentiate between different statistics in a usage parameter interface.

Note Counter mappings must only start from "2" as Rhino reserves numbers less 2.

The following example shows a Java annotation in a usage parameter interface that maps OID suffixes to two counter statistics at runtime. This is the recommended method for assigning OID mappings for usage parameter interfaces and counter statistics.

import com.opencloud.rhino.facilities.usage.UsageCounter;
import com.opencloud.rhino.facilities.usage.CounterType;

public interface WorkerPoolStats {

    @UsageCounter(mapping=2, shortName="totalThrd", description="Total number of SIP worker threads", counterType=CounterType.GAUGE)
    public void incrementThreadsTotal(long value);

    @UsageCounter(mapping=3, shortName="availThrd", description="Number of available SIP worker threads", counterType=CounterType.GAUGE)
    public void incrementThreadsAvailable(long value);

}

The following example shows the compile-time Java annotations in a usage parameters interface that assigns OID suffixes to the counter statistics.

import com.opencloud.monitoring.annotations.*;

@ParameterSetInterface("WorkerPoolStats")
@Description("SIP RA thread pool statistics")
public interface WorkerPoolStats {

    @Gauge
    @Description("Total number of SIP worker threads")
    @ShortName("totalThrd")
    @SNMPMapping(2)
    void incrementThreadsTotal(long value);

    @Gauge
    @Description("Number of available SIP worker threads")
    @ShortName("availThrd")
    @SNMPMapping(3)
    void incrementThreadsAvailable(long value);

From the compile-time annotations in the example above, the annotation processor generates the corresponding entries in a deployment descriptor, as shown below:

<stats-parameter-sets>
    <stats-parameter-set-type description="SIP RA thread pool statistics" interface="com.opencloud.slee.resources.sip.stats.WorkerPoolStats" name="WorkerPoolStats">
        <counter aggregate="True" default-view="gauge" description="Total number of SIP worker threads" is-replicated="False" mapping="2" name="threadsTotal" short-name="totalThrd"/>
        <counter aggregate="True" default-view="gauge" description="Number of available SIP worker threads" is-replicated="False" mapping="3" name="threadsAvailable" short-name="availThrd"/>
    </stats-parameter-set-type>
</stats-parameter-sets>

The Java annotations and the extension deployment descriptor above are equivalent.

Previous page Next page