21 lines
522 B
PHP
21 lines
522 B
PHP
<?php
|
|
|
|
namespace Modules\Analytics\Console;
|
|
|
|
use Illuminate\Console\Command;
|
|
use Modules\Analytics\Services\AnalyticsAggregator;
|
|
|
|
final class AggregateAnalytics extends Command
|
|
{
|
|
protected $signature = 'analytics:aggregate {--date=}';
|
|
|
|
protected $description = 'Aggregate raw analytics events into daily metrics.';
|
|
|
|
public function handle(AnalyticsAggregator $aggregator): int
|
|
{
|
|
$this->info('Metrics written: '.$aggregator->aggregate($this->option('date')));
|
|
|
|
return self::SUCCESS;
|
|
}
|
|
}
|