aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/plugin/contextswitch.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/contextswitch.php')
-rw-r--r--plugin/contextswitch.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugin/contextswitch.php b/plugin/contextswitch.php
index 8a2036f..701a3a7 100644
--- a/plugin/contextswitch.php
+++ b/plugin/contextswitch.php
@@ -12,10 +12,10 @@ require_once 'inc/collectd.inc.php';
12$obj = new Type_Default($CONFIG); 12$obj = new Type_Default($CONFIG);
13$obj->data_sources = array('value'); 13$obj->data_sources = array('value');
14$obj->ds_names = array( 14$obj->ds_names = array(
15 'contextswitches' => 'Context switches', 15 'value' => 'Context switches',
16); 16);
17$obj->colors = array( 17$obj->colors = array(
18 'contextswitches' => '0000f0', 18 'value' => '0000f0',
19); 19);
20$obj->width = $width; 20$obj->width = $width;
21$obj->heigth = $heigth; 21$obj->heigth = $heigth;
@@ -24,8 +24,15 @@ $obj->rrd_vertical = 'switch per second Bits';
24$obj->rrd_format = '%4.0lf'; 24$obj->rrd_format = '%4.0lf';
25 25
26# backwards compatibility 26# backwards compatibility
27if ($CONFIG['version'] < 5) 27if ($CONFIG['version'] < 5) {
28 $obj->data_sources = array('contextswitches'); 28 $obj->data_sources = array('contextswitches');
29 29
30 $obj->ds_names['contextswitches'] = $obj->ds_names['value'];
31 unset($obj->ds_names['value']);
32
33 $obj->colors['contextswitches'] = $obj->colors['value'];
34 unset($obj->colors['value']);
35}
36
30collectd_flush($obj->identifiers); 37collectd_flush($obj->identifiers);
31$obj->rrd_graph(); 38$obj->rrd_graph();