chore: add group to usage event

This commit is contained in:
Christy Jacob
2025-01-04 12:20:36 +05:30
parent 3a8801ed82
commit 44226178db
2 changed files with 16 additions and 1 deletions
+16
View File
@@ -51,6 +51,22 @@ class Usage extends Event
return $this;
}
/**
* Add group.
*
* @param string $key
* @return self
*/
public function addGroup(string $key): self
{
$this->metrics[] = [
'group' => $key,
];
return $this;
}
/**
* Sends metrics to the usage worker.
*
@@ -78,7 +78,6 @@ class UsageDump extends Action
/**
* End temp bug fallback
*/
$numberOfKeys = !empty($stats['keys']) ? count($stats['keys']) : 0;
$receivedAt = $stats['receivedAt'] ?? 'NONE';
if ($numberOfKeys === 0) {