diff options
author | Pim van den Berg | 2011-04-10 19:56:08 +0200 |
---|---|---|
committer | Pim van den Berg | 2011-04-10 19:56:08 +0200 |
commit | 6bc103c0c6880673f207c87466f4fcac2645bd8c (patch) | |
tree | 829fa608416de0dea83b3c9c1689cb7077dfa943 /plugin/mysql.php | |
parent | plugin: add tail plugin (diff) | |
download | apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.zip apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.tar.gz apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.tar.bz2 apt-panopticon_cgp-6bc103c0c6880673f207c87466f4fcac2645bd8c.tar.xz |
plugin: deduplicate rrd_format code
Diffstat (limited to 'plugin/mysql.php')
-rw-r--r-- | plugin/mysql.php | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/plugin/mysql.php b/plugin/mysql.php index c73c37a..aac9e88 100644 --- a/plugin/mysql.php +++ b/plugin/mysql.php | |||
@@ -9,13 +9,13 @@ require_once 'inc/collectd.inc.php'; | |||
9 | $obj = new Type_GenericStacked($CONFIG); | 9 | $obj = new Type_GenericStacked($CONFIG); |
10 | $obj->width = $width; | 10 | $obj->width = $width; |
11 | $obj->heigth = $heigth; | 11 | $obj->heigth = $heigth; |
12 | $obj->rrd_format = '%5.1lf%s'; | ||
12 | 13 | ||
13 | switch($obj->args['type']) | 14 | switch($obj->args['type']) |
14 | { | 15 | { |
15 | case 'mysql_commands': | 16 | case 'mysql_commands': |
16 | $obj->rrd_title = sprintf('MySQL commands (%s)', $obj->args['pinstance']); | 17 | $obj->rrd_title = sprintf('MySQL commands (%s)', $obj->args['pinstance']); |
17 | $obj->rrd_vertical = 'Issues/s'; | 18 | $obj->rrd_vertical = 'Issues/s'; |
18 | $obj->rrd_format = '%5.1lf%s'; | ||
19 | break; | 19 | break; |
20 | case 'mysql_handler': | 20 | case 'mysql_handler': |
21 | $obj->colors = array( | 21 | $obj->colors = array( |
@@ -33,7 +33,6 @@ switch($obj->args['type']) | |||
33 | ); | 33 | ); |
34 | $obj->rrd_title = sprintf('MySQL handler (%s)', $obj->args['pinstance']); | 34 | $obj->rrd_title = sprintf('MySQL handler (%s)', $obj->args['pinstance']); |
35 | $obj->rrd_vertical = 'Invocations'; | 35 | $obj->rrd_vertical = 'Invocations'; |
36 | $obj->rrd_format = '%5.1lf%s'; | ||
37 | break; | 36 | break; |
38 | case 'mysql_locks': | 37 | case 'mysql_locks': |
39 | $obj->colors = array( | 38 | $obj->colors = array( |
@@ -42,7 +41,6 @@ switch($obj->args['type']) | |||
42 | ); | 41 | ); |
43 | $obj->rrd_title = sprintf('MySQL locks (%s)', $obj->args['pinstance']); | 42 | $obj->rrd_title = sprintf('MySQL locks (%s)', $obj->args['pinstance']); |
44 | $obj->rrd_vertical = 'locks'; | 43 | $obj->rrd_vertical = 'locks'; |
45 | $obj->rrd_format = '%5.1lf%s'; | ||
46 | break; | 44 | break; |
47 | case 'mysql_octets': | 45 | case 'mysql_octets': |
48 | $obj->data_sources = array('rx', 'tx'); | 46 | $obj->data_sources = array('rx', 'tx'); |
@@ -56,7 +54,6 @@ switch($obj->args['type']) | |||
56 | ); | 54 | ); |
57 | $obj->rrd_title = sprintf('MySQL traffic (%s)', $obj->args['pinstance']); | 55 | $obj->rrd_title = sprintf('MySQL traffic (%s)', $obj->args['pinstance']); |
58 | $obj->rrd_vertical = 'Bits per second'; | 56 | $obj->rrd_vertical = 'Bits per second'; |
59 | $obj->rrd_format = '%5.1lf%s'; | ||
60 | break; | 57 | break; |
61 | case 'mysql_qcache': | 58 | case 'mysql_qcache': |
62 | $obj->data_sources = array('not_cached', 'inserts', 'hits', 'lowmem_prunes', 'queries_in_cache'); | 59 | $obj->data_sources = array('not_cached', 'inserts', 'hits', 'lowmem_prunes', 'queries_in_cache'); |
@@ -76,7 +73,6 @@ switch($obj->args['type']) | |||
76 | ); | 73 | ); |
77 | $obj->rrd_title = sprintf('MySQL query cache (%s)', $obj->args['pinstance']); | 74 | $obj->rrd_title = sprintf('MySQL query cache (%s)', $obj->args['pinstance']); |
78 | $obj->rrd_vertical = 'Queries/s'; | 75 | $obj->rrd_vertical = 'Queries/s'; |
79 | $obj->rrd_format = '%5.1lf%s'; | ||
80 | break; | 76 | break; |
81 | case 'mysql_threads': | 77 | case 'mysql_threads': |
82 | $obj->data_sources = array('cached', 'connected', 'running', 'created'); | 78 | $obj->data_sources = array('cached', 'connected', 'running', 'created'); |
@@ -94,7 +90,6 @@ switch($obj->args['type']) | |||
94 | ); | 90 | ); |
95 | $obj->rrd_title = sprintf('MySQL threads (%s)', $obj->args['pinstance']); | 91 | $obj->rrd_title = sprintf('MySQL threads (%s)', $obj->args['pinstance']); |
96 | $obj->rrd_vertical = 'Threads'; | 92 | $obj->rrd_vertical = 'Threads'; |
97 | $obj->rrd_format = '%5.1lf%s'; | ||
98 | break; | 93 | break; |
99 | } | 94 | } |
100 | 95 | ||