Metrics
The core connection server component of the ThingWorx Azure IoT Hub Connector provides metrics related to Connector throughput, using droppwizard metrics. The Connector uses Meters, Histograms, and Timers. For details on these types of metrics, visit. https://metrics.dropwizard.io/4.1.0/manual/core.html and refer to the following sections:
Meters
Timers
The rest of this topic describes the metrics collected for the Azure IoT Hub Connector in the following sections:
High Availability Metrics
When using the Connection Server in an HA Clustering environment, metrics are captured on a per platform basis. The per platform metrics have a "platform ID" suffixed to the metric name to identify which platform the metric is for. The "platform ID" is either:
The PLATFORM_ID service discovery tag for that platform.
The {platformHost}:{platformPort} if the service discovery tag is not specified.
Ingress Processing Metrics
The Azure IoT Hub Adapter component of the Azure IoT Hub Connector provides the following metrics for ingress processing, all under the namespace, cxserver.azure.iot.ingress:
Metric
Type / Units
Description
cxserver.azure.iot.ingress.batchItemTimer
Timer / milliseconds
The time that it takes to process a single message in a batch.
cxserver.azure.iot.ingress.batchTimer
Timer / milliseconds
The time that it takes to process an entire batch of messages.
cxserver.azure.iot.ingress.checkpointTimer
Timer / milliseconds
The time that it takes for a check-pointing operation. Confirms to Azure IoT that the Connector has handled the messages.
cxserver.azure.iot.ingress.millisBehindLatestHistogram
Histogram / milliseconds
The difference between the timestamp when the last item in the batch was queued and when it was retrieved. Ideally, the value should be zero, but it could spike under a high volume.
cxserver.azure.iot.ingress.msgCountHistogram
Histogram / message count
The number of incoming messages in each batch.
cxserver.azure.iot.ingress.msgMeter
Meter / message count
The number of incoming messages.
All ingress is tracked with this metric. It provides the count, mean_rate, and exponentially-weighted moving average, over the last one minute (m1), the last five minutes (m5), and the last 15 minutes (m15).
cxserver.azure.iot.ingress.msgSizeHistogram
Histogram /bytes
The size of incoming messages. With this metric you can measure the min, mean, max, and standard deviation of message sizes. You can also measure quantiles, such as median.
cxserver.azure.iot.ingress.property.writeTimer
Timer / milliseconds
The time that it takes to write a property to the ThingWorx Platform.
cxserver.azure.iot.ingress.twinchange.fireEventTimer
Timer / milliseconds
The time spent firing the twin change event.
* 
Messages from edge devices arrive at the Azure IoT Hub Connector in batches, rather than one by one.
Metrics for Device Jobs
There are two metrics for device jobs:
Metric
Type / Units
Description
cxserver.azure.iot.devicejobs.operationTimer
Timer /milliseconds
The amount of time spent on device job operations (getJob and cancelJob).
cxserver.azure.iot.devicejobs.searchOperationTimer
Timer /milliseconds
The amount of time spent querying for device jobs.
Metrics for Remote Services (Direct Methods)
The following table lists the metrics for remote services, which means invocation of Direct Methods:
Metric
Type / Units
Description
cxserver.azure.iot.remoteservice.invokeMethodTimer
Timer / milliseconds
The number of milliseconds spent successfully invoking Direct Methods on Azure IoT devices. This number includes the time to process responses from the Edge.
cxserver.azure.iot.remoteservice.invokeMethodTimerFailures
Timer / milliseconds
The number of milliseconds spent unsuccessfully invoking Direct Methods on Azure IoT devices.
Egress Processing Metrics
The Azure IoT Adapter component of the Azure IoT Hub Connector provides the following metrics for egress processing, all under the namespace, cxserver.azure.iot.egress .
Metric
Type/Units
Description
cxserver.azure.iot.egress .writeMsgMeter
Meter / messages per second
All egress is tracked with this metric. It provides the count, mean_rate, and exponentially-weighted moving average, over the last one minute (m1), the last five minutes (m5), and the last 15 minutes (m15).
cxserver.azure.iot.egress .readMsgMeter
Meter / messages per second
The number of times that the Connector attempts to read the device twin.
cxserver.azure.iot.egress .msgReadMsgSizeHistogram
Histogram / bytes
The size (in bytes) of device twin read.
cxserver.azure.iot.egress .property.readTimer
Timer / milliseconds
The time spent querying Azure for the device twin.
File Transfer Metrics
The Azure IoT Hub Connector provides the following metrics that are associated with file transfer capabilities of the Azure
Storage Container-specific File Repository (AzureStorageContainerFileRepository Thing) deployed in the Azure IoT Connector Extension:
Metric
Type
Description
cx.azure.iot.filerepository.read.failure
Meter / events per second
The number of times that reads from the Azure Storage Container (Blob) have failed.
cx.azure.iot.filerepository.read.size
Histogram / bytes
The amount read from the Azure Storage Container (Blob).
cx.azure.iot.filerepository.read.success
Meter / events per second
The number of times that the Connector read from the Azure Storage Container (Blob).
* 
The Copy service may make multiple reads if the file size is greater than the maximum block size of the FileTransferSubsystem. This metric captures the success of each block read, not the complete file success.
cx_azure.iot.filerepository.read.successRate
Histogram / milliseconds
The rate at which the Connector read data from the Azure Storage Container (Blob).
cx.azure.iot.filerepository.write.failure
Meter / events per second
The number of times that writes to the Azure Storage Container have failed.
cx.azure.iot.filerepository.write.size
Histogram /bytes
The amount written to the Azure Storage Container (Blob).
cx.azure.iot.filerepository.write.success
Meter / events per second
The number of times that the writes to the Azure Storage Container (Blob) have succeeded.
cx.azure.iot.filerepository.write.successRate
Histogram / bytes per millisecond
The rate at which the Connector wrote data successfully to the Azure IoT Storage Container (Blob).
cx.azure.iot.fileupload.fileSizeHistogram
Histogram / bytes
The size of the uploaded file.
cx.azure.iot.fileupload.fireEventTimer
Timer / milliseconds
The time that it takes to fire the upload event.
cx.azure.iot.fileupload.handleNotiricationTimer
Timer / milliseconds
The time that it takes to process a file upload request.
Client Metrics
The following table lists the client metrics:
Metric
Type / Units
Description
cxserver.client.clientTransportEnqueueTimeHistogram
Histogram
Currently not used.
cxserver.client.messageDurationHistogram
Histogram
Only used for Kafka fabric.
cxserver.client.messageRate
Meter
Currently not used.
cxserver.client.messageThroughputHistogram
Histogram
Currently not used.
cxserver.client.messageThroughputMeter
Meter
Currently not used.
Throughput Metrics between Connector and ThingWorx Platform
The following metrics monitor the throughput between the Connector and the ThingWorx Platform:
Metric
Type / Units
Description
cxserver.cxToPlatform.messageRate
Meter / messages
The number of messages sent from this Connector to the Platform.
cxserver.cxToPlatform.messageThroughputMeter
Meter / bytes
The amount of data sent from this Connector to the Platform
cxserver.server.messageconnections
Gauge / connections
The number of connections to the Platform
cxserver.server.messageThroughputHistogram
Histogram / bytes
The distribution of the amounts of data received from the Platform.
cxserver.server.messageThroughputMeter
Meter / bytes
The number of bytes received from the Platform.
cxserver.server.read.messageRate
Meter / messages
The number of messages received by the Connector from the Platform.
cxserver.server.serverTransportEnqueueTimeHistogram
Histogram
Only used for Kafka fabric.
cxserver.server.write.messageRate
Meter
Currently not used.
Important JVM Metrics
The following table lists some of the important JVM metrics that are collected:
JVM Metrics
Type
Name
Description
Memory Usage
memory.memory-used
Represents the amount of memory currently used (in bytes).
cxserver.jvm.total.committed
Represents the amount of memory (in bytes) that is guaranteed to be available for use by the Java virtual machine. The amount of committed memory may increase or decrease over time. The Java virtual machine may release memory to the system, and total.committed could be less than init. The value of total.committed will always be greater than or equal to total.used.
CPU Usage
cxserver.cpu.ProcessCPUTime
CPU time (or process time) is the amount of time that a CPU was used to process instructions of a computer program or operating system.
cxserver.cpu.ProcessLoad
The amount of load that the Azure IoT Hub Connector is putting on the CPU.
File Descriptor ratio
cxserver.fileDescriptorRatio
The ratio of open file descriptors (or sockets) to the maximum number of file descriptors. If all file descriptors are in use, you cannot open any more sockets for network communication or opening files. If the ratio continues to increase, it can indicate that there is a file descriptor leak.
JVM Heap Usage
cxserver.jvm.total.used
The amount of memory current used (in GB).
Metrics for KVP Stores
The following table lists metrics for the KVP stores of the Connector:
Metric
Type / Unit
Description
cxserver.store.kvp.EdgeIdentifierStash.currentSize
Gauge
Currently not used.
cxserver.store.kvp.EdgeIdentifierStash.keyExpireeTime
Gauge
Currently not used.
cxserver.store.kvp.EdgeIdentifierStash.maxSize
Gauge
Currently not used.
cxserver.store.kvp.EgressEntityNameStash.currentSize
Gauge
Currently not used.
cxserver.store.kvp.EgressEntityNameStash.keyExpireeTime
Gauge
Currently not used.
cxserver.store.kvp.EgressEntityNameStash.maxSize
Gauge
Currently not used.
cxserver.store.kvp.PropertyNameStash.currentSize
Gauge / types
The current count of property types cached.
cxserver.store.kvp.PropertyNameStash.keyExpireTime
Gauge / milliseconds
The untouched time before each entry expires.
cxserver.store.kvp.PropertyNameStash.maxSize
Gauge / count
The maximum size that the cache can grow to before old entries expire early and are removed.
cxserver.store.kvp.SecurityClaimsStash.currentSize
Gauge
Currently not used.
cxserver.store.kvp.SecurityClaimsStash.keyExpireTime
Gauge
Currently not used.
cxserver.store.kvp.SecurityClaimsStash.maxSize
Gauge
Currently not used.
cxserver.store.kvp.ThingNameStash.currentSize
Gauge
Currently not used.
cxserver.store.kvp.ThingNameStash.keyExpireTime
Gauge
Currently not used.
cxserver.store.kvp.ThingNameStash.keyExpireTime
Gauge
Currently not used.
cxserver.store.kvp.ThingTemplateNameStash.currentSize
Gauge
Currently not used.
cxserver.store.kvp.ThingTemplateNameStash.keyExpireTime
Gauge
Currently not used.
cxserver.store.kvp.ThingTemplateNameStash.maxSize
Gauge
Currently not used.
General JVM Metrics
The following table lists some of the general Java Virtual Machine metrics. Several values indicate the current state of the Java Virtual Machine every reporting interval. They are not further described here. Some documentation is available at http://metrics.dropwizard.io/3.1.0/manual/jvm/.
Name
Type
cxserver.jvm.PS-MarkSweep.time
Gauge
cxserver.jvm.PS-Scavenge.count
Gauge
cxserver.jvm.PS-Scavenge.time
Gauge
cxserver.jvm.heap.committed
Gauge
cxserver.jvm.heap.init
Gauge
cxserver.jvm.heap.max
Gauge
cxserver.jvm.heap.usage
Gauge
cxserver.jvm.heap.used
Gauge
cxserver.jvm.non-heap.committed
Gauge
cxserver.jvm.non-heap.init
Gauge
cxserver.jvm.non-heap.max
Gauge
cxserver.jvm.non-heap.usage
Gauge
cxserver.jvm.non-heap.used
Gauge
cxserver.jvm.pools.Code-Cache.committed
Gauge
cxserver.jvm.pools.Code-Cache.init
Gauge
cxserver.jvm.pools.Code-Cache.max
Gauge
cxserver.jvm.pools.Code-Cache.usage
Gauge
cxserver.jvm.pools.Code-Cache.used
Gauge
cxserver.jvm.pools.Compressed-Class-Space.committed
Gauge
cxserver.jvm.pools.Compressed-Class-Space.init
Gauge
cxserver.jvm.pools.Compressed-Class-Space.max
Gauge
cxserver.jvm.pools.Compressed-Class-Space.usage
Gauge
cxserver.jvm.pools.Compressed-Class-Space.used
Gauge
cxserver.jvm.pools.Metaspace.committed
Gauge
cxserver.jvm.pools.Metaspace.init
Gauge
cxserver.jvm.pools.Metaspace.max
Gauge
cxserver.jvm.pools.Metaspace.usage
Gauge
cxserver.jvm.pools.Metaspace.used
Gauge
cxserver.jvm.pools.PS-Eden-Space.committed
Gauge
cxserver.jvm.pools.PS-Eden-Space.init
Gauge
cxserver.jvm.pools.PS-Eden-Space.max
Gauge
cxserver.jvm.pools.PS-Eden-Space.usage
Gauge
cxserver.jvm.pools.PS-Eden-Space.used
Gauge
cxserver.jvm.pools.PS-Eden-Space.used-after-gc
Gauge
cxserver.jvm.pools.PS-Old-Gen.committed
Gauge
cxserver.jvm.pools.PS-Old-Gen.init
Gauge
cxserver.jvm.pools.PS-Old-Gen.max
Gauge
cxserver.jvm.pools.PS-Old-Gen.usage
Gauge
cxserver.jvm.pools.PS-Old-Gen.used
Gauge
cxserver.jvm.pools.PS-Survivor-Space.committed
Gauge
cxserver.jvm.pools.PS-Survivor-Space.init
Gauge
cxserver.jvm.pools.PS-Survivor-Space.max
Gauge
cxserver.jvm.pools.PS-Survivor-Space.usage
Gauge
cxserver.jvm.pools.PS-Survivor-Space.used
Gauge
cxserver.jvm.pools.PS-Survivor-Space.used-after-gc
Gauge
cxserver.jvm.pools.direct.bufferCount
Gauge
cxserver.jvm.pools.direct.memoryUsed
Gauge
cxserver.jvm.pools.direct.totalCapacity
Gauge
cxserver.jvm.pools.mapped.bufferCount
Gauge
cxserver.jvm.pools.mapped.memoryUsed
Gauge
cxserver.jvm.pools.mapped.totalCapacity
Gauge
cxserver.jvm.total.committed
Gauge
cxserver.jvm.total.init
Gauge
cxserver.jvm.total.max
Gauge
cxserver.jvm.total.used
Gauge
cxserver.os.file_descriptor.ratio
Gauge