-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
horizon:reset-metrics
command (#1318)
* Add reset-metric artisan command * Be more specific to only delete the lock key * Update ResetMetricsCommand.php * Update RedisMetricsRepository.php * formatting * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
- Loading branch information
1 parent
f6f80b3
commit 3a1474a
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Laravel\Horizon\Console; | ||
|
||
use Illuminate\Console\Command; | ||
use Laravel\Horizon\Contracts\MetricsRepository; | ||
|
||
class ClearMetricsCommand extends Command | ||
{ | ||
/** | ||
* The name and signature of the console command. | ||
* | ||
* @var string | ||
*/ | ||
protected $signature = 'horizon:clear-metrics'; | ||
|
||
/** | ||
* The console command description. | ||
* | ||
* @var string | ||
*/ | ||
protected $description = 'Delete metrics for all jobs and queues'; | ||
|
||
/** | ||
* Execute the console command. | ||
* | ||
* @param \Laravel\Horizon\Contracts\MetricsRepository $metrics | ||
* @return void | ||
*/ | ||
public function handle(MetricsRepository $metrics) | ||
{ | ||
$metrics->reset(); | ||
|
||
$this->info('Metrics cleared successfully.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters