<?php namespace Spechal\Lcgp; $config = \Config::get('lcgp::collectd'); // host comes from the controller that load the plugin $config['host'] = $host; $config['plugin'] = 'ntpd'; $obj = new CollectdGraphDefault($config); $obj->setDataSourceNames(array('ping' => 'Ping Time', 'ping_stddev' => 'Ping Std. Deviation', 'ping_droprate' => 'Ping Drop Rate')); switch ($_GET['type']) { case 'delay': $obj->setTitle('Delay')->setVertical('Seconds'); break; case 'frequency_offset': $obj->setTitle('Frequency Offset')->setVertical('ppm'); break; case 'time_dispersion': $obj->setTitle('Time Dispersion')->setVertical('Seconds'); break; case 'time_offset': $obj->setTitle('Time Offset')->setVertical('Seconds'); break; default: break; } $obj->setFormat('%5.1lf%s'); $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'] = '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();
$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();