Peter's Solaris Zone

Kstat Activity Reporter

6 Apr 2014: stable version 1.1. Download | KAR on GitHub

Traditionally, sar - system activity reporter, has been used to save and display a small subset of system activity.

Sar suffers from being incomplete and inextensible, and some of the statistics it does report are no longer useful.

Kar - kstat activity reporter - is an effort to archive and display a more complete set of system statistics.

The basic idea is really simple: rather than save the limited set of statistics reported by sar, simply save everything tracked by the kstat framework and do any aggregation or analysis when the user needs it.

The result is a system that is as complete as the kstat framework, and is immediately extensible - new kstats get picked up automatically rather than having to modify the framework. And because the raw data is saved, it can be analysed and displayed in any way you see fit: you aren't limited to the handful of results that the authors of sar thought you might need.

I started out by simply saving something like the output of kstat -p at regular intervals. (In version 0.1, it really was kstat -p, and 0.2 introduced a slight variant of that format that was more complete, before JSON was standardized on in 0.7.) To keep disk usage down, the output is stored in a zip file (thus compressed) for each day. That's it.

Simple is sometimes good. And that's about as simple and unsophisticated as it gets.

You can unpack the zip files and chew through the files with awk/sed/grep or perl or whatever and sling that at your graphing tool of choice.

Or, jkstat can read in the zip files and allow you to browse the statistics and generate charts.

Version history

0.1
Initial prototype, just containing collector.
0.2
Add sample sar and iostat clients using jkstat. Add custom kar_collector and enhanced output format.
0.3
Add sample mpstat and fsstat clients; add -z option to iostat client; code cleanups.
0.4
Add graph generation and a file browser with the kstat browser and chart builder.
0.5
Add print subcommand, fix the sparc permissions, and enhance the install script(s).
0.5.1
Generating the graphs is much quicker.
0.6
Sparc collector actually works; graph generation skips past failed graphs; many bugs fixed.
0.6.5
Interim release that adds support for JSON format, allowing you to transition to the new format and convert old archives.
0.7
JSON only release.
0.8
Makes the graphs work again.
0.9
Add heatmaps and graphite support.
0.10
Add cpustat subcommand and allow apps to disable the json cache.
1.0
Stable release.
1.1
Update jkstat and jfreechart.

Peter's Home | Zone Home