From 10ad741a22797b6710be1091d9e502e71929f255 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Fri, 17 Sep 2010 21:24:35 +0200 Subject: automatic alignment of graph legend Function fill_ds_names is renamed to parse_ds_names and now also appends spaces to ds_names to make them equal of lenght. --- plugin/apache.php | 20 ++++++++++---------- plugin/cpu.php | 12 ++++++------ plugin/disk.php | 2 +- plugin/interface.php | 2 +- plugin/memcached.php | 12 ++++++------ plugin/memory.php | 8 ++++---- plugin/netlink.php | 25 ++++++++++++------------- plugin/processes.php | 10 +++++----- plugin/sensors.php | 2 +- plugin/swap.php | 6 +++--- plugin/vmem.php | 6 +++--- 11 files changed, 52 insertions(+), 53 deletions(-) (limited to 'plugin') diff --git a/plugin/apache.php b/plugin/apache.php index 1dc3540..7153662 100644 --- a/plugin/apache.php +++ b/plugin/apache.php @@ -13,17 +13,17 @@ $obj = new Type_GenericStacked($CONFIG); $obj->data_sources = array('count'); $obj->order = array('open', 'idle_cleanup', 'finishing', 'logging', 'closing', 'dnslookup', 'keepalive', 'sending', 'reading', 'starting', 'waiting'); $obj->ds_names = array( - 'open' => 'Open (empty) ', - 'waiting' => 'Waiting ', - 'starting' => 'Starting up ', + 'open' => 'Open (empty)', + 'waiting' => 'Waiting', + 'starting' => 'Starting up', 'reading' => 'Reading request', - 'sending' => 'Sending reply ', - 'keepalive' => 'Keepalive ', - 'dnslookup' => 'DNS Lookup ', - 'closing' => 'Closing ', - 'logging' => 'Logging ', - 'finishing' => 'Finishing ', - 'idle_cleanup' => 'Idle cleanup ', + 'sending' => 'Sending reply', + 'keepalive' => 'Keepalive', + 'dnslookup' => 'DNS Lookup', + 'closing' => 'Closing', + 'logging' => 'Logging', + 'finishing' => 'Finishing', + 'idle_cleanup' => 'Idle cleanup', ); $obj->colors = array( 'open' => 'e0e0e0', diff --git a/plugin/cpu.php b/plugin/cpu.php index 081427f..5aeaf24 100644 --- a/plugin/cpu.php +++ b/plugin/cpu.php @@ -21,14 +21,14 @@ $obj = new Type_GenericStacked($CONFIG); $obj->data_sources = array('value'); $obj->order = array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal'); $obj->ds_names = array( - 'idle' => 'Idle ', - 'nice' => 'Nice ', - 'user' => 'User ', + 'idle' => 'Idle', + 'nice' => 'Nice', + 'user' => 'User', 'wait' => 'Wait-IO', - 'system' => 'System ', + 'system' => 'System', 'softirq' => 'SoftIRQ', - 'interrupt' => 'IRQ ', - 'steal' => 'Steal ', + 'interrupt' => 'IRQ', + 'steal' => 'Steal', ); $obj->colors = array( 'idle' => 'e8e8e8', diff --git a/plugin/disk.php b/plugin/disk.php index 0f7a11a..63015d8 100644 --- a/plugin/disk.php +++ b/plugin/disk.php @@ -16,7 +16,7 @@ require_once 'inc/collectd.inc.php'; $obj = new Type_GenericIO($CONFIG); $obj->data_sources = array('read', 'write'); $obj->ds_names = array( - 'read' => 'Read ', + 'read' => 'Read', 'write' => 'Written', ); $obj->colors = array( diff --git a/plugin/interface.php b/plugin/interface.php index da8a573..82b9f25 100644 --- a/plugin/interface.php +++ b/plugin/interface.php @@ -15,7 +15,7 @@ require_once 'inc/collectd.inc.php'; $obj = new Type_GenericIO($CONFIG); $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( diff --git a/plugin/memcached.php b/plugin/memcached.php index b8dff28..6157d69 100644 --- a/plugin/memcached.php +++ b/plugin/memcached.php @@ -47,8 +47,8 @@ switch($_GET['t']) { $obj->order = array('flush', 'get', 'set'); $obj->ds_names = array( 'flush' => 'Flush', - 'get' => 'Get ', - 'set' => 'Set ', + 'get' => 'Get', + 'set' => 'Set', ); $obj->colors = array( 'flush' => '00e000', @@ -96,7 +96,7 @@ switch($_GET['t']) { $obj->data_sources = array('rx', 'tx'); $obj->order = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( @@ -113,8 +113,8 @@ switch($_GET['t']) { $obj->order = array('evictions', 'hits', 'misses'); $obj->ds_names = array( 'evictions' => 'Evictions', - 'hits' => 'Hits ', - 'misses' => 'Misses ', + 'hits' => 'Hits', + 'misses' => 'Misses', ); $obj->colors = array( 'evictions' => '00e000', @@ -162,7 +162,7 @@ switch($_GET['t']) { $obj->data_sources = array('user', 'syst'); $obj->order = array('user', 'syst'); $obj->ds_names = array( - 'user' => 'User ', + 'user' => 'User', 'syst' => 'System', ); $obj->colors = array( diff --git a/plugin/memory.php b/plugin/memory.php index 71e395c..ca85078 100644 --- a/plugin/memory.php +++ b/plugin/memory.php @@ -16,11 +16,11 @@ require_once 'inc/collectd.inc.php'; $obj = new Type_GenericStacked($CONFIG); $obj->order = array('free', 'buffered', 'cached', 'locked', 'used'); $obj->ds_names = array( - 'free' => 'Free ', - 'cached' => 'Cached ', + 'free' => 'Free', + 'cached' => 'Cached', 'buffered' => 'Buffered', - 'locked' => 'Locked ', - 'used' => 'Used ', + 'locked' => 'Locked', + 'used' => 'Used', ); $obj->colors = array( 'free' => '00e000', diff --git a/plugin/netlink.php b/plugin/netlink.php index f9b4fa6..9352f66 100644 --- a/plugin/netlink.php +++ b/plugin/netlink.php @@ -23,7 +23,7 @@ switch($obj->args['type']) { case 'if_dropped': $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( @@ -36,7 +36,7 @@ switch($obj->args['type']) { case 'if_errors': $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( @@ -56,7 +56,7 @@ switch($obj->args['type']) { case 'if_octets': $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( @@ -69,7 +69,7 @@ switch($obj->args['type']) { case 'if_packets': $obj->data_sources = array('rx', 'tx'); $obj->ds_names = array( - 'rx' => 'Receive ', + 'rx' => 'Receive', 'tx' => 'Transmit', ); $obj->colors = array( @@ -79,16 +79,15 @@ switch($obj->args['type']) { $obj->rrd_title = sprintf('Interface Packets (%s)', $obj->args['pinstance']); $obj->rrd_vertical = 'Packets/s'; break; - break; case 'if_rx_errors': $obj->data_sources = array('value'); $obj->ds_names = array( - 'crc' => 'CRC ', - 'fifo' => 'FiFo ', - 'frame' => 'Frame ', + 'crc' => 'CRC', + 'fifo' => 'FiFo', + 'frame' => 'Frame', 'length' => 'Lenght', 'missed' => 'Missed', - 'over' => 'Over ', + 'over' => 'Over', ); $obj->colors = array( 'crc' => '00e000', @@ -104,11 +103,11 @@ switch($obj->args['type']) { case 'if_tx_errors': $obj->data_sources = array('value'); $obj->ds_names = array( - 'aborted' => 'Aborted ', - 'carrier' => 'Carrier ', - 'fifo' => 'FiFo ', + 'aborted' => 'Aborted', + 'carrier' => 'Carrier', + 'fifo' => 'FiFo', 'heartbeat'=> 'Heartbeat', - 'window' => 'Window ', + 'window' => 'Window', ); $obj->colors = array( 'aborted' => 'f00000', diff --git a/plugin/processes.php b/plugin/processes.php index 934dead..caf445b 100644 --- a/plugin/processes.php +++ b/plugin/processes.php @@ -17,11 +17,11 @@ require_once 'inc/collectd.inc.php'; $obj = new Type_GenericStacked($CONFIG); $obj->ds_names = array( - 'paging' => 'Paging ', - 'blocked' => 'Blocked ', - 'zombies' => 'Zombies ', - 'stopped' => 'Stopped ', - 'running' => 'Running ', + 'paging' => 'Paging', + 'blocked' => 'Blocked', + 'zombies' => 'Zombies', + 'stopped' => 'Stopped', + 'running' => 'Running', 'sleeping' => 'Sleeping', 'value' => 'Forks', ); diff --git a/plugin/sensors.php b/plugin/sensors.php index 4724492..33a642d 100644 --- a/plugin/sensors.php +++ b/plugin/sensors.php @@ -14,7 +14,7 @@ require_once 'inc/collectd.inc.php'; $obj = new Type_Default($CONFIG); $obj->ds_names = array( - 'value' => 'Value ', + 'value' => 'Value', ); $obj->width = $width; $obj->heigth = $heigth; diff --git a/plugin/swap.php b/plugin/swap.php index a8d06d4..7902081 100644 --- a/plugin/swap.php +++ b/plugin/swap.php @@ -17,9 +17,9 @@ switch($_GET['t']) { $obj = new Type_GenericStacked($CONFIG); $obj->order = array('free', 'cached', 'used'); $obj->ds_names = array( - 'free' => 'Free ', + 'free' => 'Free', 'cached' => 'Cached', - 'used' => 'Used ', + 'used' => 'Used', ); $obj->colors = array( 'free' => '00e000', @@ -35,7 +35,7 @@ switch($_GET['t']) { $obj->order = array('out', 'in'); $obj->ds_names = array( 'out' => 'Out', - 'in' => 'In ', + 'in' => 'In', ); $obj->colors = array( 'out' => '0000ff', diff --git a/plugin/vmem.php b/plugin/vmem.php index e465932..d7f9830 100644 --- a/plugin/vmem.php +++ b/plugin/vmem.php @@ -29,10 +29,10 @@ switch($obj->args['type']) { break; case 'vmpage_io': $obj->data_sources = array('in', 'out'); - $obj->ds_names = array('memory-in' => 'Memory (in) ', + $obj->ds_names = array('memory-in' => 'Memory (in)', 'memory-out' => 'Memory (out)', - 'swap-in' => 'Swap (in) ', - 'swap-out' => 'Swap (out) '); + 'swap-in' => 'Swap (in)', + 'swap-out' => 'Swap (out)'); $obj->colors = array('memory-in' => 'ff0000', 'memory-out' => '0000ff', 'swap-in' => 'ff00ff', -- cgit v1.1