Skip to content

Linux Device Component

The Linux Device component facilitates the attainment of system metrics on the target that XRT is executing on.

The Device component supports the following:

  • Acquirement of CPU, Disk I/O, Memory, Network Interface, and Network I/O system statistics.
  • Statistics are obtained at a specified interval in units of milliseconds.
  • Metrics are published on a specified topic.

Linux Device Configuration

The following table describes the configuration variables that can be used with the Linux Device component:

Parameter Type Description Valid Values Required
Bus String The name of the Bus component to use The name of an existing Bus component Y
Logger String The name of the Logger component to use The name of an existing Logger component N
ThreadPool String The name of the ThreadPool component to use The name of an existing Threadpool component Y
Scheduler String The name of the Scheduler component to use The name of an existing Scheduler component Y
Schedules Object Contains the Schedules configuration for the Device The Device Schedules configuration
For further information, see the table below
Y

Schedules Fields

The Schedules fields are described in the following table:

Parameter Type Description Valid Values
Interval Unsigned Integer Obtain metrics at given interval Interval in milliseconds
Topic String The topic to publish on A valid topic name
SeparateEvents Boolean If True, all specified metrics published in a single message
If False, each specified metric is published individually
Boolean value
Sync Boolean If True, push data immediately to the subscriber
If False, schedule delivery using a pool thread
Boolean value
Metrics Array of Strings Enable specified metrics Valid values are as follows:
  • CPU
  • Memory
  • DiskIO
  • NetworkIO
  • NetworkInterface

IOTech provides the following template, you can update this to meet your requirements:

{
  "Library": "libxrt-linux-device.so",
  "Factory": "xrt_linux_device_factory",
  "Bus": "bus",
  "Scheduler":"sched",
  "ThreadPool":"pool",
  "Schedules": [
    { "Interval": 250, "Metrics": ["CPU", "Memory"], "Topic": "device/metrics1", "SeparateEvents": false, "Sync": true},
    { "Interval": 500, "Metrics": ["NetworkIO", "CPU"], "Topic": "device/metrics2", "SeparateEvents": true},
    { "Interval": 1000, "Metrics": ["DiskIO"], "Topic": "device/metrics3", "SeparateEvents": false, "Sync": true},
    { "Interval": 5000, "Metrics": ["NetworkInterface"], "Topic": "device/metrics4", "SeparateEvents": false},
    { "Interval": 10000, "Metrics": ["Memory", "CPU", "DiskIO"], "Topic": "device/metrics5", "SeparateEvents": true}
  ],
  "Logger":"logger"
}
Back to top