PHP code example of jmonitor / jmonitor-bundle

1. Go to this page and download the library: Download jmonitor/jmonitor-bundle 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/ */

    

jmonitor / jmonitor-bundle example snippets

bash
php bin/console jmonitor:collect -vvv --dry-run
yaml
# config/routes/jmonitor.yaml
jmonitor_expose_php_metrics:
    path: '/jmonitor/php-metrics'
    controller: Jmonitor\JmonitorBundle\Controller\JmonitorPhpController

# Secured route in production with localhost host restriction
# Refer to symfony docs for more information about security
when@prod:
    jmonitor_expose_php_metrics:
        path: '/jmonitor/php-metrics'
        controller: Jmonitor\JmonitorBundle\Controller\JmonitorPhpController
        host: localhost
yaml
# config/packages/jmonitor.yaml
jmonitor:
    # ...
    collectors:
        php:
            endpoint: 'http://localhost/jmonitor/php-metrics'
bash
    php bin/console jmonitor:collect --vv --memory-limit=32M --time-limit=3600
    
bash
php bin/console jmonitor:collect mysql -vvv --dry-run