Compare commits

...
Author SHA1 Message Date
Christy Jacob 44226178db chore: add group to usage event 2025-01-04 12:20:36 +05:30
Christy Jacob 3a8801ed82 feat: add new attribute to stats table 2024-12-31 16:39:47 +05:30
3 changed files with 34 additions and 1 deletions
+18
View File
@@ -1606,6 +1606,17 @@ $commonCollections = [
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('group'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 255,
'signed' => false,
'required' => false,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => ID::custom('region'),
'type' => Database::VAR_STRING,
@@ -1673,6 +1684,13 @@ $commonCollections = [
'lengths' => [],
'orders' => [Database::ORDER_DESC],
],
[
'$id' => ID::custom('group'),
'type' => Database::INDEX_KEY,
'attributes' => [ID::custom('group')],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
]
],
],
+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) {