Skip to content

Instantly share code, notes, and snippets.

@Torstein-Eide
Last active July 27, 2018 21:17
Show Gist options
  • Save Torstein-Eide/6976d0772562dff0707e19b807bf2c13 to your computer and use it in GitHub Desktop.
Save Torstein-Eide/6976d0772562dff0707e19b807bf2c13 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "Script must be run as user: root"
sudo $0
wait 1
fi
while true
do
clear
echo STATS | socat - /var/run/rrdcached.sock
sleep 1
done
@Torstein-Eide
Copy link
Author

Torstein-Eide commented Jul 19, 2018

example output:

9 Statistics follow
QueueLength: 0
UpdatesReceived: 45867
FlushesReceived: 0
UpdatesWritten: 4595
DataSetsWritten: 43225
TreeNodesNumber: 601
TreeDepth: 11
JournalBytes: 5046651
JournalRotate: 6

Performance Values

The following counters are returned by the STATS command:

QueueLength (unsigned 64bit integer)
Number of nodes currently enqueued in the update queue.

UpdatesReceived (unsigned 64bit integer)
Number of UPDATE commands received.

FlushesReceived (unsigned 64bit integer)
Number of FLUSH commands received.

UpdatesWritten (unsigned 64bit integer)
Total number of updates, i. e. calls to rrd_update_r, since the daemon was started.

DataSetsWritten (unsigned 64bit integer)
Total number of "data sets" written to disk since the daemon was started. A data set is one or more values passed to the UPDATE command. For example: 1223661439:123:456 is one data set with two values. The term "data set" is used to prevent confusion whether individual values or groups of values are counted.

TreeNodesNumber (unsigned 64bit integer)
Number of nodes in the cache.

TreeDepth (unsigned 64bit integer)
Depth of the tree used for fast key lookup.

JournalBytes (unsigned 64bit integer)
Total number of bytes written to the journal since startup.

JournalRotate (unsigned 64bit integer)
Number of times the journal has been rotated since startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment