PHP code example of metrics-tracker / watchlog

1. Go to this page and download the library: Download metrics-tracker/watchlog library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

metrics-tracker / watchlog example snippets


   use MetricsTracker\Watchlog;

   $watchlog = new Watchlog();
   $watchlog->increment('page_views');
   // Optionally increment by a different value
   $watchlog->increment('page_views', 5);
   

   $watchlog->decrement('active_users');
   // Optionally decrement by a different value
   $watchlog->decrement('active_users', 2);
   

   $watchlog->gauge('memory_usage', 512);
   

   $watchlog->percentage('cpu_usage', 75);
   

   $watchlog->systembyte('disk_space', 1024000);