Monitoring the Azure IoT Hub Connector > Metrics > Background Information on Metrics
Background Information on Metrics
The ThingWorx Azure IoT Hub Connector uses Meter, Histogram, and Timer types of metrics from the Logback library. For more information on metrics, visit http://metrics.dropwizard.io.
Meters, Histograms, and Timers
This section offers a brief introduction to the three types of metrics used by the Connector. The three types of metrics are:
Meter — Measures the rate at which a set of events occur. For example, the rate at which messages arrive from edge devices. Meters measure the rate in the following ways:
The mean rate is the average rate of events. It represents the total rate for the lifetime of an application. For example, the total number of egress messages, divided by the number of seconds the process has been running.
If you need a sense of how recent events occurred, meters also provide exponentially-weighted moving average rates. The m1, m5, and m15 averages record moving averages over the last one minute, the last five minutes, and the last fifteen minutes.
If the meter is named requests, most reporters produce requests.mean_rate, requests.1m_rate, requests.5m_rate, and requests.15m_rate. For more details, refer to Meters in the dropwizard documentation.
Histogram — Measures the distribution of values in a stream of data. For example, the number of entries in a batch of messages sent from edge devices. This type of metric enables you to measure min, mean, max, and standard deviation of values as well as quantiles such as the median or a percentile. For more details, refer to Histograms in the dropwizard documentation.
Timer — Measures the duration of a type of event (histogram) and the rate of its occurrence (a meter). For details, refer to Timers in the dropwizard documentation.
There are two key details with respect to metrics reporting, which may help understanding:
1. Collection and reporting are separate
a. A Timer, for example, is used to measure the time for each individual operation, but it does not track all those time spans. Instead, it holds statistics about the time spans: min, max, mean, percentiles, standard deviation, and so forth.
b. Reporters are set up to push values on an interval (in the configuration file for the Connector). The current statistics are pulled and pushed to the destination.
2. Each metric is usually expanded to additional metrics. Refer to http://metrics.dropwizard.io/3.1.0/manual/core/) See the definition of Meter above.
When messages arrive in batches, the batches may contain messages from the same edge device or a mix of messages from different devices. Azure stores all the incoming messages within a set of queues, one per partition (partition-count is set on hub creation). Each device will send messages to a single partition, but multiple devices share a partition. The Connector has a set of consumers, one per partition, each reading batches. The time span of messages covered by a single batch is determined by the sending rate of edge devices and the time it takes the Connector/ThingWorx Platform to process a single batch.