public function __construct(MysqlStorage $storage, Run $run, $pending, $running, $succeeded, $failed)
{
$this->storage = $storage;
$this->run = $run;
$this->cacheCount['all'] = $all = $pending + $running + $succeeded + $failed;
$this->cacheCount['pending'] = $pending;
$this->cacheCount['running'] = $running;
$this->cacheCount['succeeded'] = $succeeded;
$this->cacheCount['failed'] = $failed;
$this->cacheCount['finished'] = $finished = $succeeded + $failed;
$this->cacheCount['is_pending'] = $pending && !$running;
$this->cacheCount['is_running'] = $running > 0;
$this->cacheCount['is_succeeded'] = $all == $succeeded;
$this->cacheCount['is_failed'] = $all == $finished && $failed > 0;
$this->cacheCount['is_finished'] = $all == $finished;
}