collection for usage stats

This commit is contained in:
Damodar Lohani 2021-08-11 10:59:27 +05:45
parent e87435dd61
commit 0f69216d66

View file

@ -1403,6 +1403,84 @@ $collections = [
],
],
],
'stats' => [
'$collection' => Database::COLLECTIONS,
'$id' => 'stats',
'name' => 'Stats',
'attributes' => [
[
'$id' => 'metric',
'type' => Database::VAR_STRING,
'format' => '',
'size' => 255,
'signed' => true,
'required' => true,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'value',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => false,
'required' => true,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'time',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 0,
'signed' => false,
'required' => true,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'period',
'type' => Database::VAR_STRING,
'format' => '',
'size' => 4,
'signed' => true,
'required' => true,
'default' => null,
'array' => false,
'filters' => [],
],
[
'$id' => 'type',
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 1,
'signed' => false,
'required' => true,
'default' => 0, // 0 -> count, 1 -> sum
'array' => false,
'filters' => [],
],
],
'indexes' => [
[
'$id' => '_key_time',
'type' => Database::INDEX_KEY,
'attributes' => ['time'],
'lengths' => [100],
'orders' => [Database::ORDER_DESC],
],
[
'$id' => '_key_time_period',
'type' => Database::INDEX_KEY,
'attributes' => ['time', 'period'],
'lengths' => [100, 4],
'orders' => [Database::ORDER_DESC],
],
],
]
];
return $collections;