Docs
PHP API wrapper
A ready for production PHP API wrapper is available on packagist for easy install with Composer.
Getting started with Idlemon is easy, you just need your project token, no need to create the monitors beforehand, Idlemon does that automatically if a monitor slug is not recognized for the project.
Place this block in the start of your code.
<?php $projectToken = '0123456789abcdef0123456789abcdef'; // Token for the project $monitorName = 'your_monitor_slug'; // Name for your monitor $idlemon = new Idlemon($projectToken); // Initialize Idlemon with project token $log = Idlemon::createLog($monitorName); // Duration clock is started here ?>
You just need to insert a token for the project and select a name for your monitor.
Then you initialize the Idlemon object and create a log object to automatically start a timer to record the duration
of the process.
Place this block in the end of your code.
<?php $log->setMeta('meta_name', 'meta_value'); // Example of adding some meta data $idlemon->send($log); // Sends information to idlemon ?>
Before the log is sent to Idlemon, you have an option of adding some meta data to the log, like how many records was processed. You can display and track these meta values with graphs on the dashboard to keep track of your monitors.
That is it, next time your process runs Idlemon will recieve the information and start to monitor the process.