Creating a Function Catalog

Procedure

  1. Create a function catalog file. For example, my.function.catalog. Create the function descriptors as shown in the following sample:

   <function-descriptors name="my-functions">
      <function-descriptor name="My.AVG"
     category="my category" multivalued="false" 
     implclass="com.tibco.rta.runtime.metric.functions.MyMetric"
      datatype="DOUBLE" description="My metric function">
   </function-descriptor>
Function Descriptors Properties
Property Name Description
name Name of the function
category The category name
multivalued Indicates whether or not the function is single-valued or multivalued. The default value is false. Remember that for a multivalued function, all values must be of the same datatype.
implclass To create custom metric function, you should extend either SingleValueMetricFunction or MultiValueMetricFunction.

For more information about the API, refer to the TIBCO Service Performance Manager Java API reference pages.

datatype Datatype of the metric. For example, the datatype of AVERAGE is generally be a double.
description Description of the metric function

  1. Create the function parameters as shown in the following example:
        <function-params>
        <function-param id="PARAM1" datatype="LONG" ordinal="0"
         description="Measuable Quanitity to be averaged" />
        </function-params>

    Specify the function parameters, data types, and the ordinal position. The parameters specified here are bound to the fact attributes in the <product_name>_schema.xml. For example, the ID specified for the parameter is used in the schema to bind the parameter to the fact.

    Binding Function Parameters to the Schema
  2. Each metric can store some contextual data for future reuse. The context definition is also used by the database schema generator to generate columns in the metric tables. For each metric, the associated context is stored in these columns in the database. Create the function context as shown in the following example:
        <function-context>
             <function-param id="count" datatype="LONG" ordinal="0"
             description="" />
             <function-param id="sum" datatype="DOUBLE" ordinal="1"
           description="" />
        </function-context>
      </function-descriptor>
    </function-descriptors>