mute / pinba
Implements Pinba in pure PHP
dev-master
2013-08-30 13:01 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-12-16 15:54:33 UTC
README
Implements Pinba in pure PHP. See examples for usage.
This library package requires PHP 5.3 or later.
How to use this library
Monitor a script, with a timer:
<?php $collector = new \Mute\Pinba\DataCollector(SCRIPT_NAME, HOST_NAME); // start monitoring $collector->start(); // monitor a function $timer = $collector->timer(array('foo' => 'bar'))->start(); func(); $timer->stop(); // stop monitoring $collector->stop(); // send result to Pinba Server $reporter = new \Mute\Pinba\Reporter(ADDRESS_HOST, ADDRESS_PORT); $reporter($collector);