setQueue(Event::USAGE_DUMP_QUEUE_NAME) ->setClass(Event::USAGE_DUMP_CLASS_NAME); } /** * Add Stats. * * @param array $stats * @return self */ public function setStats(array $stats): self { $this->stats = $stats; return $this; } /** * Sends metrics to the usage worker. * * @return string|bool */ public function trigger(): string|bool { $client = new Client($this->queue, $this->connection); return $client->enqueue([ 'stats' => $this->stats, ]); } }