<?php
declare(strict_types=1);

namespace PpPhp\Core\Platform\Event\Scheduler;

final class SchedulerStatistics
{
    public function __construct(
        private readonly int $pending,
        private readonly int $completed,
        private readonly int $cancelled,
        private readonly int $failed
    ) {}

    public function pending(): int { return $this->pending; }

    public function toArray(): array
    {
        return [
            'pending' => $this->pending,
            'completed' => $this->completed,
            'cancelled' => $this->cancelled,
            'failed' => $this->failed,
            'total' => $this->pending + $this->completed + $this->cancelled + $this->failed,
        ];
    }
}
