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.
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).
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.
SCREENSHOT 44) Set the “Tooltip mode” to “All” to show all the queries’ results for a given time in the tooltip.
SCREENSHOT 45) Select the legend type “Table” for better visibility.
Scroll down if needed.
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.
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.
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.
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.