1
0
Fork 0
mirror of synced 2024-10-04 04:06:16 +13:00

usage collections fix

This commit is contained in:
shimon 2023-07-12 16:02:42 +03:00
parent c656d8571a
commit d282dbf787
2 changed files with 42 additions and 15 deletions

View file

@ -1052,7 +1052,6 @@ $auth = Config::getParam('auth', []);
], ],
] ]
], ],
'stats' => [ 'stats' => [
'$collection' => ID::custom(Database::METADATA), '$collection' => ID::custom(Database::METADATA),
'$id' => ID::custom('stats'), '$id' => ID::custom('stats'),
@ -1085,7 +1084,7 @@ $auth = Config::getParam('auth', []);
'type' => Database::VAR_INTEGER, 'type' => Database::VAR_INTEGER,
'format' => '', 'format' => '',
'size' => 8, 'size' => 8,
'signed' => false, 'signed' => true,
'required' => true, 'required' => true,
'default' => null, 'default' => null,
'array' => false, 'array' => false,
@ -1113,17 +1112,6 @@ $auth = Config::getParam('auth', []);
'array' => false, 'array' => false,
'filters' => [], 'filters' => [],
], ],
[
'$id' => ID::custom('type'),
'type' => Database::VAR_INTEGER,
'format' => '',
'size' => 1,
'signed' => false,
'required' => true,
'default' => 0, // 0 -> count, 1 -> sum
'array' => false,
'filters' => [],
],
], ],
'indexes' => [ 'indexes' => [
[ [
@ -1142,13 +1130,51 @@ $auth = Config::getParam('auth', []);
], ],
[ [
'$id' => ID::custom('_key_metric_period_time'), '$id' => ID::custom('_key_metric_period_time'),
'type' => Database::INDEX_KEY, 'type' => Database::INDEX_UNIQUE,
'attributes' => ['metric', 'period', 'time'], 'attributes' => ['metric', 'period', 'time'],
'lengths' => [], 'lengths' => [],
'orders' => [Database::ORDER_DESC], 'orders' => [Database::ORDER_DESC],
], ],
], ],
], ],
'statsLogger' => [
'$collection' => ID::custom(Database::METADATA),
'$id' => ID::custom('statsLogger'),
'name' => 'StatsLogger',
'attributes' => [
[
'$id' => ID::custom('time'),
'type' => Database::VAR_DATETIME,
'format' => '',
'size' => 0,
'signed' => false,
'required' => false,
'default' => null,
'array' => false,
'filters' => ['datetime'],
],
[
'$id' => ID::custom('metrics'),
'type' => Database::VAR_STRING,
'format' => '',
'size' => 5012,
'signed' => true,
'required' => false,
'default' => [],
'array' => false,
'filters' => ['json'],
],
],
'indexes' => [
[
'$id' => ID::custom('_key_time'),
'type' => Database::INDEX_KEY,
'attributes' => ['time'],
'lengths' => [],
'orders' => [Database::ORDER_DESC],
],
],
],
]; ];
$projectCollections = array_merge([ $projectCollections = array_merge([

View file

@ -277,7 +277,8 @@ $server
])); ]));
} }
} catch (\Exception $e) { } catch (\Exception $e) {
console::error("[logger] " . " {DateTime::now()} " . " {$projectInternalId} " . " {$e->getMessage()}"); $now = DateTime::now();
console::error("[Error] " . " Time: {$now} " . " projectInternalId: {$projectInternalId}" . " File: {$e->getFile()}" . " Line: {$e->getLine()} " . " message: {$e->getMessage()}");
} finally { } finally {
$pools->reclaim(); $pools->reclaim();
} }