Create graph for swap usage using Grafana, InfluxDB and collectd

SCREENSHOT 41) Add a group by tag_instance to split the different tags in the graph.

The tag_instance shows the swap usage, which could be: cached, free, and used.

main menu
group by tag type_instance

SCREENSHOT 42) To give pretty names to the tags in the graph’s legend add to the ALIAS a variable $tag_[tag_key] and in this case, the tag key is type_instance so that the variable will be $tag_type_instance.

There is an important variable “$__interval“, which may be edited and set to the rate of the original data (if applicable, not really for the swap usage) or left as is to be computed each time based on the selected time frame of the graph (6 hours for this example).

main menu
alias tag type instance

SCREENSHOT 43) Set the graph title to the right where is the graph options – Swap IO Usage.

The query is ready and several graph options follow.

main menu
graph title

SCREENSHOT 44) Set the “Tooltip mode” to “All” to show all the queries’ results for a given time in the tooltip.

main menu
Tooltip mode All

SCREENSHOT 45) Select the legend type “Table” for better visibility.

Scroll down if needed.

main menu
Legend table

SCREENSHOT 46) Add additional values in the legend for the measurements like the current value of the measurements and so on.

Add “Last*” and select another values.

main menu
legend values

SCREENSHOT 47) 4 calculations are selected to be shown in the graph legend – Last, Mean, Min, Max.

These 4 calculations are meaningful for the current measurement – Swap usage. There are many more in the drop-down list.

main menu
legend last mean min max

SCREENSHOT 48) Scrow down to the Graphs styles sub-menu and chose “Always” for the “Connect null values”

If there are some missing values there won’t be gaps in the graphs.

main menu
connect null values

SCREENSHOT 49) The units of the swap io usage are Kilobytes/s (the counter is pages/sec, so number*4*1024 bytes/s).

This is valid only on a Linux system with 4Kbytes page size.

main menu
Standard options Unites Kilobytes per second

SCREENSHOT 50) Increase the lines width in the graph for better readability.

main menu
Line width

Leave a Reply

Your email address will not be published. Required fields are marked *