$obj->setColors(array('value' => '00B000')); $obj->setTitle('Number of connections')->setVertical('Connections'); break; case 'memcached_items': $obj = new CollectdGraphDefault($config); $obj->setDataSources(array('value')); $obj->setDataSourceNames(array('value' => 'Items')); $obj->setColors(array('value' => '00B000')); $obj->setTitle('Items in cache')->setVertical('Items'); break; case 'memcached_octets': $obj = new CollectdGraphDefault($config); $obj->setDataSources(array('rx', 'tx')); $obj->setDataSourceNames(array('rx' => 'Receive', 'tx' => 'Transmit')); $obj->setColors(array('rx' => '0000FF', 'tx' => '00B000')); $obj->setTitle('Network Traffic (' . $obj->getArg('plugin_instance') . ')')->setVertical('Bytes per second'); break; case 'memcached_ops': $obj = new CollectdGraphStacked($config); $obj->setDataSourceNames(array('evictions' => 'Evictions', 'hits' => 'Hits', 'misses' => 'Misses')); $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;
<?php namespace Spechal\Lcgp; $config = \Config::get('lcgp::collectd'); // host comes from the controller that load the plugin $config['host'] = $host; $config['plugin'] = 'varnish'; $obj = new CollectdGraphDefault($config); $obj->setTitle(ucfirst($obj->getArg('plugin_instance')))->setVertical('Hits')->setFormat('%5.1lf%s'); $graphs[$config['plugin']][] = $obj->rrd_graph();