Metric Publish Adapter

Introduction

The TIBCO Streaming® Metric Publish Adapter allows a Streaming application to define and update business metrics.

Adapter Properties Tab

Property Description
Metric Name The unique name of this metric. If the metric name is in use, the Streaming application will fail to start.
Metric Description A human-readable description of this metric.
Metric Type The type of this metric. See below for descriptions of the different types.
Reservoir Type The reservoir type determines how incoming data will be sampled for the Histogram and Timer metric types. See below for descriptions of the available reservoir types.
Meter Moving Average Type The Meter Moving Average Type determines how a moving average will be computed for the Meter metric type.
Log Level Controls the level of verbosity the adapter uses to send notifications to the console. This setting can be higher than the containing application's log level. If set lower, the system log level is used. Available values, in increasing order of verbosity, are: OFF, ERROR, WARN, INFO, DEBUG, TRACE.

Cluster Aware Tab

Use the settings in this tab to allow this operator or adapter to start and stop based on conditions that occur at runtime in a cluster with more than one node. During initial development of the fragment that contains this operator or adapter, and for maximum compatibility with TIBCO Streaming releases before 10.5.0, leave the Cluster start policy control in its default setting, Start with module.

Cluster awareness is an advanced topic that requires an understanding of StreamBase Runtime architecture features, including clusters, quorums, availability zones, and partitions. See Cluster Awareness Tab Settings on the Using Cluster Awareness page for instructions on configuring this tab.

Concurrency Tab

Use the Concurrency tab to specify parallel regions for this instance of this component, or multiplicity options, or both. The Concurrency tab settings are described in Concurrency Options, and dispatch styles are described in Dispatch Styles.

Caution

Concurrency settings are not suitable for every application, and using these settings requires a thorough analysis of your application. For details, see Execution Order and Concurrency, which includes important guidelines for using the concurrency options.

Input Port

The input port is used to send tuples with metric actions and values. A metric action describes a method for updating a metric, and a value is a parameter to that method.

In addition to the two required fields of the below schema, other fields may be used to provide properties on the metric. Any field which is not MetricAction or Value must have a field type of string and will be registered as a property of the metric.

If a metric is registered with properties, values must be provided for all properties in each input tuple. Please note that the '.' character is currently an invalid character in property values.

Field Name Field Type Description
MetricAction string The method of updating the adapter's metric. Each metric type supports a different set of metric actions. See section below on Metric Types for supported MetricAction values.
Value long The parameter to the method indicated by MetricAction. For example, if MetricAction is INC, and Value is 5, a Counter or Gauge metric will increment its value by 5.

Status Port

The status output port emits tuples with the below schema.

Field Name Field Type Description
Status string If the adapter successfully processes an update to its metric, Status will be OK. If an error occurs during processing, Status will be ERROR.
Message string If Status is OK, Message will be a description of the metric update which took place. If Status is ERROR, Message will be an explanation of what went wrong.

Metric Types

The Streaming runtime supports five metric types. Each metric type supports a different set of metric actions. Each metric action is parameterized by a single Long integer value. In the table below, "Value" refers to this Long integer parameter.

In addition to the metric actions described below, each metric type also supports a RESET metric action that resets the metric to its initial state.

Metric Type Metric Actions Description
Gauge
  • SET — Set the gauge to Value.

  • INC — Increment the gauge by Value.

  • DEC — Decrement the gauge by Value.

A gauge is used for metrics which expose a single value that may be set arbitrarily.
Counter
  • INC — Increment the counter by Value.

  • DEC — Decrement the counter by Value.

A counter is used for metrics which expose a single value that may be incremented or decremented by a provided value.
Histogram
  • RECORD — Record Value into the histogram's distribution.

A histogram computes various statistics over a distribution of values. These statistics include the minimum, maximum, mean, standard deviation and quantiles of a distribution.
Meter
  • MARK — Mark that an event has occurred Value times so that its rate may be computed.

A meter measures the rate of Streaming events.
Timer
  • TIME — Mark that an event took Value nanoseconds.

A timer computes the same statistics as a histogram and also the rate at which the event occurs.

Reservoir Types

A reservoir is used by a Histogram or a Timer metric to sample incoming data. Several reservoir sampling methods are available.

Reservoir Type Description
Exponentially Decaying Reservoir Exponentially weight more recent data.
Sliding Time Window Array Reservoir Stores samples from last 100 seconds. WARNING: This reservoir is not bounded in size.
Sliding Time Window Reservoir Deprecated. Use Sliding Time Window Array Reservoir instead.
Sliding Window Reservoir Stores last 1028 samples.
Uniform Reservoir Randomly sample last 1028 samples.

Meter Moving Average Types

The meter metric type supports two types of moving averages.

Moving Average Type Description
Exponential Moving Average Exponentially weights recent data so that the average is biased towards the recent past.
Sliding Time Window Moving Average Weights samples evenly.