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/dns.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/dns.php')
| -rw-r--r-- | plugin/dns.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugin/dns.php b/plugin/dns.php index 15143b5..d0784df 100644 --- a/plugin/dns.php +++ b/plugin/dns.php | |||
| @@ -15,6 +15,8 @@ require_once 'inc/collectd.inc.php'; | |||
| 15 | $obj = new Type_GenericStacked($CONFIG); | 15 | $obj = new Type_GenericStacked($CONFIG); |
| 16 | $obj->width = $width; | 16 | $obj->width = $width; |
| 17 | $obj->heigth = $heigth; | 17 | $obj->heigth = $heigth; |
| 18 | $obj->rrd_format = '%5.1lf%s'; | ||
| 19 | |||
| 18 | switch($obj->args['type']) { | 20 | switch($obj->args['type']) { |
| 19 | case 'dns_octets': | 21 | case 'dns_octets': |
| 20 | $obj->data_sources = array( | 22 | $obj->data_sources = array( |
| @@ -31,19 +33,16 @@ switch($obj->args['type']) { | |||
| 31 | ); | 33 | ); |
| 32 | $obj->rrd_title = 'DNS traffic'; | 34 | $obj->rrd_title = 'DNS traffic'; |
| 33 | $obj->rrd_vertical = 'Bit/s'; | 35 | $obj->rrd_vertical = 'Bit/s'; |
| 34 | $obj->rrd_format = '%5.1lf%s'; | ||
| 35 | break; | 36 | break; |
| 36 | case 'dns_opcode': | 37 | case 'dns_opcode': |
| 37 | $obj->data_sources = array('value'); | 38 | $obj->data_sources = array('value'); |
| 38 | $obj->rrd_title = 'DNS Opcode Query'; | 39 | $obj->rrd_title = 'DNS Opcode Query'; |
| 39 | $obj->rrd_vertical = 'Queries/s'; | 40 | $obj->rrd_vertical = 'Queries/s'; |
| 40 | $obj->rrd_format = '%5.1lf%s'; | ||
| 41 | break; | 41 | break; |
| 42 | case 'dns_qtype': | 42 | case 'dns_qtype': |
| 43 | $obj->data_sources = array('value'); | 43 | $obj->data_sources = array('value'); |
| 44 | $obj->rrd_title = 'DNS QType'; | 44 | $obj->rrd_title = 'DNS QType'; |
| 45 | $obj->rrd_vertical = 'Queries/s'; | 45 | $obj->rrd_vertical = 'Queries/s'; |
| 46 | $obj->rrd_format = '%5.1lf%s'; | ||
| 47 | break; | 46 | break; |
| 48 | } | 47 | } |
| 49 | 48 | ||
