From dae438c070bb02e50c231a9ac6f7ea4b9b90fd2c Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Fri, 10 Aug 2012 19:02:29 +0200 Subject: plugin: convert spaces to tabs --- plugin/memcached.php | 94 +++++++++++++------------- plugin/nfs.php | 12 ++-- plugin/vmem.php | 2 +- plugin/vserver.php | 187 +++++++++++++++++++++++++-------------------------- 4 files changed, 147 insertions(+), 148 deletions(-) diff --git a/plugin/memcached.php b/plugin/memcached.php index accf6b3..2230f3f 100644 --- a/plugin/memcached.php +++ b/plugin/memcached.php @@ -24,9 +24,9 @@ require_once 'inc/collectd.inc.php'; switch(GET('t')) { # df-cache.rrd case 'df': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG); - $obj->data_sources = array('used', 'free'); + require_once 'type/Default.class.php'; + $obj = new Type_Default($CONFIG); + $obj->data_sources = array('used', 'free'); $obj->order = array('used', 'free'); $obj->ds_names = array( 'used' => 'Used', @@ -54,7 +54,7 @@ switch(GET('t')) { $obj->colors = array( 'flush' => '00e000', 'get' => '0000ff', - 'set' => 'ffb000', + 'set' => 'ffb000', ); $obj->rrd_title = 'Memcached Commands'; $obj->rrd_vertical = 'Commands'; @@ -62,39 +62,39 @@ switch(GET('t')) { # memcached_connections-current.rrd case 'memcached_connections': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG); - $obj->data_sources = array('value'); - $obj->ds_names = array( - 'value' => 'Connections', - ); - $obj->colors = array( - 'percent' => '00b000', - ); + require_once 'type/Default.class.php'; + $obj = new Type_Default($CONFIG); + $obj->data_sources = array('value'); + $obj->ds_names = array( + 'value' => 'Connections', + ); + $obj->colors = array( + 'percent' => '00b000', + ); $obj->rrd_title = 'Memcached Number of Connections'; $obj->rrd_vertical = 'Connections'; - break; + break; # memcached_items-current.rrd case 'memcached_items': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG); - $obj->data_sources = array('value'); - $obj->ds_names = array( - 'value ' => 'Items', - ); - $obj->colors = array( - 'value' => '00b000', - ); + require_once 'type/Default.class.php'; + $obj = new Type_Default($CONFIG); + $obj->data_sources = array('value'); + $obj->ds_names = array( + 'value ' => 'Items', + ); + $obj->colors = array( + 'value' => '00b000', + ); $obj->rrd_title = 'Number of Items in Memcached'; $obj->rrd_vertical = 'Items'; - break; + break; # memcached_octets.rrd case 'memcached_octets': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG); - $obj->data_sources = array('rx', 'tx'); + require_once 'type/Default.class.php'; + $obj = new Type_Default($CONFIG); + $obj->data_sources = array('rx', 'tx'); $obj->order = array('rx', 'tx'); $obj->ds_names = array( 'rx' => 'Receive', @@ -115,13 +115,13 @@ 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', - 'hits' => '0000ff', - 'misses' => 'ffb000', + 'hits' => '0000ff', + 'misses' => 'ffb000', ); $obj->rrd_title = 'Memcached Operations'; $obj->rrd_vertical = 'Commands'; @@ -129,23 +129,23 @@ switch(GET('t')) { # percent-hitratio.rrd case 'percent': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG); - $obj->data_sources = array('percent'); - $obj->ds_names = array( - 'percent ' => 'Percentage', - ); - $obj->colors = array( - 'percent' => '00e000', - ); + require_once 'type/Default.class.php'; + $obj = new Type_Default($CONFIG); + $obj->data_sources = array('percent'); + $obj->ds_names = array( + 'percent ' => 'Percentage', + ); + $obj->colors = array( + 'percent' => '00e000', + ); $obj->rrd_title = 'Memcached Hits/Gets Ratio'; $obj->rrd_vertical = 'Percent'; - break; + break; # ps_count.rrd case 'ps_count': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG); - $obj->data_sources = array('threads'); + require_once 'type/Default.class.php'; + $obj = new Type_Default($CONFIG); + $obj->data_sources = array('threads'); $obj->order = array('threads'); $obj->ds_names = array( 'threads' => 'Threads', @@ -159,9 +159,9 @@ switch(GET('t')) { # ps_cputime.rrd case 'ps_cputime': - require_once 'type/Default.class.php'; - $obj = new Type_Default($CONFIG); - $obj->data_sources = array('user', 'syst'); + require_once 'type/Default.class.php'; + $obj = new Type_Default($CONFIG); + $obj->data_sources = array('user', 'syst'); $obj->order = array('user', 'syst'); $obj->ds_names = array( 'user' => 'User', diff --git a/plugin/nfs.php b/plugin/nfs.php index ca69b06..b9bc78e 100644 --- a/plugin/nfs.php +++ b/plugin/nfs.php @@ -15,13 +15,13 @@ require_once 'inc/collectd.inc.php'; $obj = new Type_GenericStacked($CONFIG); $obj->data_sources = array('value'); switch($obj->args['pinstance']) { - case 'v2client': - $obj->order = array('create', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'null', 'readdir', 'readlink', 'read', 'remove', 'rename', 'rmdir', 'root', 'setattr', 'symlink', 'wrcache', 'write'); - break; + case 'v2client': + $obj->order = array('create', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'null', 'readdir', 'readlink', 'read', 'remove', 'rename', 'rmdir', 'root', 'setattr', 'symlink', 'wrcache', 'write'); + break; - case 'v3client': - $obj->order = array('access', 'commit', 'create', 'fsinfo', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'mknod', 'null', 'pathconf', 'read', 'readdir', 'readdirplus', 'readlink', 'remove', 'rename', 'rmdir', 'setattr', 'symlink', 'write'); - break; + case 'v3client': + $obj->order = array('access', 'commit', 'create', 'fsinfo', 'fsstat', 'getattr', 'link', 'lookup', 'mkdir', 'mknod', 'null', 'pathconf', 'read', 'readdir', 'readdirplus', 'readlink', 'remove', 'rename', 'rmdir', 'setattr', 'symlink', 'write'); + break; } $obj->width = $width; diff --git a/plugin/vmem.php b/plugin/vmem.php index 2fae536..fae94f8 100644 --- a/plugin/vmem.php +++ b/plugin/vmem.php @@ -46,7 +46,7 @@ switch($obj->args['type']) { $obj->order = array('active_anon', 'active_file', 'anon_pages', 'bounce', 'dirty', 'file_pages', - 'free_pages', 'inactive_anon', + 'free_pages', 'inactive_anon', 'inactive_file', 'mapped', 'mlock', 'page_table_pages', 'slab_reclaimable', 'slab_unreclaimable', diff --git a/plugin/vserver.php b/plugin/vserver.php index e51d97d..204134e 100644 --- a/plugin/vserver.php +++ b/plugin/vserver.php @@ -28,110 +28,109 @@ require_once 'inc/collectd.inc.php'; $obj = new Type_Default($CONFIG); switch($obj->args['type']) { - case 'load': - require_once "plugin/load.php"; - break; - case 'vs_memory': - $obj = new Type_GenericStacked($CONFIG); - $obj->order = array('vm', 'vml', 'rss', 'anon'); - # http://oldwiki.linux-vserver.org/Memory+Allocation - $obj->ds_names = array( - 'vm' => "Virtual memory pages", - 'vml' => "Pages locked into memory", - 'rss' => "Resident set size", - 'anon' => "Anonymous memory pages", - ); - $obj->colors = array( - 'vm' => '00e000', - 'vml' => '0000ff', - 'rss' => 'ffb000', - 'anon' => 'ff00ff', - ); - $obj->width = $width; - $obj->heigth = $heigth; + case 'load': + require_once "plugin/load.php"; + break; + case 'vs_memory': + $obj = new Type_GenericStacked($CONFIG); + $obj->order = array('vm', 'vml', 'rss', 'anon'); + # http://oldwiki.linux-vserver.org/Memory+Allocation + $obj->ds_names = array( + 'vm' => "Virtual memory pages", + 'vml' => "Pages locked into memory", + 'rss' => "Resident set size", + 'anon' => "Anonymous memory pages", + ); + $obj->colors = array( + 'vm' => '00e000', + 'vml' => '0000ff', + 'rss' => 'ffb000', + 'anon' => 'ff00ff', + ); + $obj->width = $width; + $obj->heigth = $heigth; - $obj->rrd_title = sprintf('Memory utilization on Vserver %s', $obj->args['pinstance']); + $obj->rrd_title = sprintf('Memory utilization on Vserver %s', $obj->args['pinstance']); $obj->rrd_vertical = ucfirst($CONFIG['datasize']); $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; - $obj->rrd_format = '%5.1lf%s'; + $obj->rrd_format = '%5.1lf%s'; - collectd_flush($obj->identifiers); - $obj->rrd_graph(); - break; - case 'vs_threads': - $obj = new Type_GenericStacked($CONFIG); - $obj->order = array('running', 'uninterruptable', 'onhold', 'total'); - # http://linux-vserver.org/ProcFS - $obj->ds_names = array( - 'onhold' => "Number of threads on hold", - 'running' => "Number of running threads", - 'total' => "Total number of threads", - 'uninterruptable' => "Number of uninterruptible threads", - ); - $obj->colors = array( - 'onhold' => '00e000', - 'running' => '0000ff', - 'total' => 'ffb000', - 'uninterruptable' => 'ff00ff', - ); - $obj->width = $width; - $obj->heigth = $heigth; + collectd_flush($obj->identifiers); + $obj->rrd_graph(); + break; + case 'vs_threads': + $obj = new Type_GenericStacked($CONFIG); + $obj->order = array('running', 'uninterruptable', 'onhold', 'total'); + # http://linux-vserver.org/ProcFS + $obj->ds_names = array( + 'onhold' => "Number of threads on hold", + 'running' => "Number of running threads", + 'total' => "Total number of threads", + 'uninterruptable' => "Number of uninterruptible threads", + ); + $obj->colors = array( + 'onhold' => '00e000', + 'running' => '0000ff', + 'total' => 'ffb000', + 'uninterruptable' => 'ff00ff', + ); + $obj->width = $width; + $obj->heigth = $heigth; - $obj->rrd_title = sprintf('Threads on Vserver %s', $obj->args['pinstance']); - $obj->rrd_vertical = 'Numbers'; - $obj->rrd_format = '%5.1lf%s'; + $obj->rrd_title = sprintf('Threads on Vserver %s', $obj->args['pinstance']); + $obj->rrd_vertical = 'Numbers'; + $obj->rrd_format = '%5.1lf%s'; - collectd_flush($obj->identifiers); - $obj->rrd_graph(); - break; - case 'if_octets': - $obj->data_sources = array('rx', 'tx'); - $obj->ds_names = array( - 'inet-rx' => 'IPv4 Receive', - 'inet-tx' => 'IPv4 Transmit', - 'inet6-rx' => 'IPv6 Receive', - 'inet6-tx' => 'IPv6 Transmit', - ); - $obj->colors = array( - 'inet-rx' => '0000ff', - 'inet-tx' => '00b000', - 'inet6-rx' => 'e0e0e0', - 'inet6-tx' => 'ffb000', - 'other-rx' => 'ff00ff', - 'other-tx' => 'a000a0', - 'unix-rx' => '00e000', - 'unix-tx' => '0080ff', - 'unspec-rx' => 'ff0000', - 'unspec-tx' => '000080', - ); - $obj->rrd_title = sprintf('Traffic on Vserver %s', $obj->args['pinstance']); + collectd_flush($obj->identifiers); + $obj->rrd_graph(); + break; + case 'if_octets': + $obj->data_sources = array('rx', 'tx'); + $obj->ds_names = array( + 'inet-rx' => 'IPv4 Receive', + 'inet-tx' => 'IPv4 Transmit', + 'inet6-rx' => 'IPv6 Receive', + 'inet6-tx' => 'IPv6 Transmit', + ); + $obj->colors = array( + 'inet-rx' => '0000ff', + 'inet-tx' => '00b000', + 'inet6-rx' => 'e0e0e0', + 'inet6-tx' => 'ffb000', + 'other-rx' => 'ff00ff', + 'other-tx' => 'a000a0', + 'unix-rx' => '00e000', + 'unix-tx' => '0080ff', + 'unspec-rx' => 'ff0000', + 'unspec-tx' => '000080', + ); + $obj->rrd_title = sprintf('Traffic on Vserver %s', $obj->args['pinstance']); $obj->rrd_vertical = sprintf('%s per second', ucfirst($CONFIG['datasize'])); $obj->scale = $CONFIG['datasize'] == 'bits' ? 8 : 1; - $obj->width = $width; - $obj->heigth = $heigth; - $obj->rrd_format = '%5.1lf%s'; + $obj->width = $width; + $obj->heigth = $heigth; + $obj->rrd_format = '%5.1lf%s'; - collectd_flush($obj->identifiers); - $obj->rrd_graph(); - break; - case 'vs_processes': - $obj->data_sources = array('value'); - $obj->ds_names = array( - 'value' => 'Processes', - ); - $obj->rrd_title = sprintf('Processes on Vserver %s', $obj->args['pinstance']); - $obj->rrd_vertical = 'Processes'; + collectd_flush($obj->identifiers); + $obj->rrd_graph(); + break; + case 'vs_processes': + $obj->data_sources = array('value'); + $obj->ds_names = array( + 'value' => 'Processes', + ); + $obj->rrd_title = sprintf('Processes on Vserver %s', $obj->args['pinstance']); + $obj->rrd_vertical = 'Processes'; - $obj->width = $width; - $obj->heigth = $heigth; - $obj->rrd_format = '%5.1lf%s'; + $obj->width = $width; + $obj->heigth = $heigth; + $obj->rrd_format = '%5.1lf%s'; - collectd_flush($obj->identifiers); - $obj->rrd_graph(); - break; + collectd_flush($obj->identifiers); + $obj->rrd_graph(); + break; - default: - die('Not implemented yet.'); - break; + default: + die('Not implemented yet.'); + break; } -?> -- cgit v1.1