Skip to main content

Statistic Collection

The stats hook collects statistics about nodes. Currently the following metrics are collected:

IdentifierUnitDescription
skippedsamplesSkipped samples and the distance between them
reorderedsamplesReordered samples and the distance between them
gap_sentsecondsInter-message timestamps (as sent by remote)
gap_receivedsecondsInter-message arrival time (as received by this instance)
owdsecondsOne-way-delay (OWD) of received messages

If the node to which this hook is attached an rtp node-type, the following additional statistics are collected from the RTP reception reports. The contains details about the quality of service as seen be the receiver.

IdentifierUnitDescription
rtp.loss_fractionpercentFraction lost since last RTP SR/RR.
rtp.pkts_lostpacketsCumulative number of packets lost.
rtp.jitterseconds?Inter-arrival jitter

For each of the metrics the following moments / attributes are collected:

MomentTypeDescription
lastfloatThe last collected value.
highestfloatThe highest/largest collected value.
lowestfloatThe lowest/smallest collected value.
meanfloatThe mean across all collected values.
varfloatThe variance across all collected values.
stddevfloatThe standard deviation across all collected values.
totalintegerThe total number of collected values.

Implementation​

The source code of the hook is available here: https://github.com/VILLASframework/node/blob/master/lib/hooks/stats.cpp

Configuration​

Format Object (object) or Format Name (string) (format_spec)
buckets
integer
Default: 20

The number of buckets which should be used for the underlying histograms.

warmup
integer
Default: 500

Use the first warmup samples to estimate the bucket range of the underlying histograms.

verbose
boolean
Default: false

Include full dumps of the histogram buckets into the output.

output
string
Default: "/dev/stdout"

The file where you want to write the report to. If omitted, stdout (the terminal) will be used.

enabled
boolean
Default: true

An optional field which can be used to disable a hook.

priority
integer
Default: 99

The priority of this hook which determines the order in which hooks are executed. Hooks with a lwoer priority are executed before ones with a higher priority.

If no priority is configured, hooks are executed in the order they are configured in the configuration file.

{
  • "format": "villas.human",
  • "buckets": 20,
  • "warmup": 500,
  • "verbose": false,
  • "output": "/dev/stdout",
  • "enabled": true,
  • "priority": 99
}

Example

node/etc/examples/hooks/stats.conf
stats = 1

nodes = {
signal_node = {
type = "signal"
signal = "mixed"
values = 5
rate = 50

in = {
hooks = (
{
type = "stats"

verbose = true
warmup = 10
buckets = 25
}
)
}
}
}

paths = (
{
in = "signal_node"
}
)