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

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

Peter's Home | Zone Home