diff options
| author | Aurélien ROUGEMONT | 2011-04-18 20:02:00 +0200 | 
|---|---|---|
| committer | Pim van den Berg | 2011-04-18 20:02:00 +0200 | 
| commit | e7b54cf7ef457f9a7358efb7c99ab4c44631d925 (patch) | |
| tree | 2edd0f147a06f41a315f1efa81e9d2898cd720c9 /plugin | |
| parent | plugin: deduplicate rrd_format code (diff) | |
| download | apt-panopticon_cgp-e7b54cf7ef457f9a7358efb7c99ab4c44631d925.zip apt-panopticon_cgp-e7b54cf7ef457f9a7358efb7c99ab4c44631d925.tar.gz apt-panopticon_cgp-e7b54cf7ef457f9a7358efb7c99ab4c44631d925.tar.bz2 apt-panopticon_cgp-e7b54cf7ef457f9a7358efb7c99ab4c44631d925.tar.xz | |
plugin: add contextswitch plugin
Diffstat (limited to '')
| -rw-r--r-- | plugin/contextswitch.php | 27 | 
1 files changed, 27 insertions, 0 deletions
| diff --git a/plugin/contextswitch.php b/plugin/contextswitch.php new file mode 100644 index 0000000..ddb3276 --- /dev/null +++ b/plugin/contextswitch.php | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | # Collectd Entropy plugin | ||
| 4 | |||
| 5 | require_once 'conf/common.inc.php'; | ||
| 6 | require_once 'type/Default.class.php'; | ||
| 7 | require_once 'inc/collectd.inc.php'; | ||
| 8 | |||
| 9 | ## LAYOUT | ||
| 10 | # contextswitch/contextswitch.rrd | ||
| 11 | |||
| 12 | $obj = new Type_Default($CONFIG); | ||
| 13 | $obj->data_sources = array('contextswitches'); | ||
| 14 | $obj->ds_names = array( | ||
| 15 | 'contextswitches' => 'Context switches', | ||
| 16 | ); | ||
| 17 | $obj->colors = array( | ||
| 18 | 'contextswitches' => '0000f0', | ||
| 19 | ); | ||
| 20 | $obj->width = $width; | ||
| 21 | $obj->heigth = $heigth; | ||
| 22 | $obj->rrd_title = 'Context switches'; | ||
| 23 | $obj->rrd_vertical = 'switch per second Bits'; | ||
| 24 | $obj->rrd_format = '%4.0lf'; | ||
| 25 | |||
| 26 | collectd_flush($obj->identifiers); | ||
| 27 | $obj->rrd_graph(); | ||
