PHP code example of fidum / laravel-dashboard-vapor-metrics-tile

1. Go to this page and download the library: Download fidum/laravel-dashboard-vapor-metrics-tile 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/ */

    

fidum / laravel-dashboard-vapor-metrics-tile example snippets


// in config/dashboard.php
return [
    // ...
    'tiles' => [
        'vapor_metrics' => [
            'secret' => env('VAPOR_API_TOKEN'), // optional: Uses `VAPOR_API_TOKEN` env by default
            'refresh_interval_in_seconds' => 300, // optional: Default: 300 seconds (5 minutes)
            'period' => '7d', // optional: 1m, 5m, 30m, 1h, 8h, 1d (default), 3d, 7d, 1M
            'caches' => [ // Leave empty if you don't want any cache tiles
                'My Cache Instance' => [ // Key will be used as the title of the displayed tile
                    'cache_id' => 222, // d of your vapor database instance
                    'period' => '7d', // optional: 1m, 5m, 30m, 1h, 8h, 1d (default), 3d, 7d, 1M
                    'refresh_interval_in_seconds' => 60, // optional: override individual tile
                    'secret' => null, // :optional: override individual tile
                ],
                'Another Database' => ['database_id' => 444]
            ],
            'environments' => [ // Leave empty if you don't want any envrionment tiles
                'My Staging Website' => [ // Key will be used as the title of the displayed tile                
                    'project_id' => 1111, // 

// in app/console/Kernel.php
protected function schedule(Schedule $schedule)
{
    $schedule->command(\Fidum\VaporMetricsTile\Commands\FetchVaporCacheMetricsCommand::class)->everyThirtyMinutes();
    $schedule->command(\Fidum\VaporMetricsTile\Commands\FetchVaporDatabaseMetricsCommand::class)->everyThirtyMinutes();
    $schedule->command(\Fidum\VaporMetricsTile\Commands\FetchVaporEnvironmentMetricsCommand::class)->everyThirtyMinutes();
}