<?php namespace Spechal\Lcgp; $config = \Config::get('lcgp::collectd'); // host comes from the controller that load the plugin $config['host'] = $host; $config['plugin'] = 'contextswitch'; $obj = new CollectdGraphDefault($config); $obj->setDataSources(array('value')); $obj->setDataSourceNames(array('value' => 'Context Switches')); $obj->setColors(array('value' => '000F00')); $obj->setTitle('Context Switches'); $obj->setVertical('Switches per second'); $obj->setFormat('%4.0lf'); $graphs[$config['plugin']][] = $obj->rrd_graph();
<?php namespace Spechal\Lcgp; $config = \Config::get('lcgp::collectd'); // host comes from the controller that load the plugin $config['host'] = $host; $config['plugin'] = 'apache'; $obj = new CollectdGraphDefault($config); $obj->setDataSources(array('value')); switch ($_GET['type']) { case 'apache_bytes': $obj->setDataSourceNames(array('value' => 'Bytes')); $obj->setTitle('Traffic')->setVertical('Bytes per second'); $obj->setColors(array('value' => '0000FF')); break; case 'apache_connections': $obj->setDataSourceNames(array('value' => 'Connections per second')); $obj->setTitle('Connections')->setVertical('Connections per second'); $obj->setColors(array('value' => '00B000')); break; case 'apache_idle_workers': $obj->setDataSourceNames(array('value' => 'Workers')); $obj->setTitle('Idle Workers')->setVertical('Workers'); $obj->setColors(array('value' => '0000FF')); break; case 'apache_requests': $obj->setDataSourceNames(array('value' => 'Requests per second')); $obj->setTitle('Requests')->setVertical('Requests per second'); $obj->setColors(array('value' => '00B000')); break;
$obj->setOrder(array('evictions', 'hits', 'misses')); $obj->setColors(array('evictions' => '00E000', 'hits' => '0000FF', 'misses' => 'FFB000')); $obj->setTitle('Operations')->setVertical('Commands'); break; case 'percent': $obj = new CollectdGraphDefault($config); $obj->setDataSources(array('value')); $obj->setDataSourceNames(array('value' => 'Percent')); $obj->setColors(array('value' => '00B000')); $obj->setTitle('Hit/Miss Ratio')->setVertical('Percent'); break; case 'ps_count': $obj = new CollectdGraphDefault($config); $obj->setDataSources(array('threads')); $obj->setDataSourceNames(array('threads' => 'Threads')); $obj->setColors(array('threads' => '00B000')); $obj->setTitle('Thread Count')->setVertical('Number of threads'); break; case 'ps_cputime': $obj = new CollectdGraphDefault($config); $obj->setDataSources(array('user', 'syst')); $obj->setDataSourceNames(array('user' => 'User', 'syst' => 'System')); $obj->setOrder(array('user', 'syst')); $obj->setColors(array('user' => '00E000', 'syst' => '0000FF')); $obj->setTitle('CPU Time')->setVertical('Time'); break; default: break; } $obj->setFormat("%5.1lf"); $graphs[$config['plugin']][] = $obj->rrd_graph();
<?php namespace Spechal\Lcgp; $config = \Config::get('lcgp::collectd'); // host comes from the controller that load the plugin $config['host'] = $host; $config['plugin'] = 'load'; $obj = new CollectdGraphDefault($config); $obj->setDataSources(array('shortterm', 'midterm', 'longterm')); $obj->setDataSourceNames(array('shortterm' => '1 min', 'midterm' => '5 min', 'longterm' => '15 min')); $obj->setColors(array('shortterm' => '00FF00', 'midterm' => '0000FF', 'longterm' => 'FF0000')); $obj->setTitle('Load')->setVertical('System Load')->setFormat('%.2lf'); $graphs[$config['plugin']][] = $obj->rrd_graph();