feat: add migration counts to hamster
This commit is contained in:
parent
f81d675609
commit
8eb8351d5f
|
@ -41,6 +41,7 @@ class CalcTierStats extends Action
|
||||||
'Functions',
|
'Functions',
|
||||||
'Deployments',
|
'Deployments',
|
||||||
'Executions',
|
'Executions',
|
||||||
|
'Migrations',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected string $directory = '/usr/local';
|
protected string $directory = '/usr/local';
|
||||||
|
@ -290,6 +291,13 @@ class CalcTierStats extends Action
|
||||||
$stats['Executions'] = 0;
|
$stats['Executions'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Get Total Migrations */
|
||||||
|
try {
|
||||||
|
$stats['Migrations'] = $dbForProject->count('migrations', []);
|
||||||
|
} catch (\Throwable) {
|
||||||
|
$stats['Migrations'] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$csv->insertOne(array_values($stats));
|
$csv->insertOne(array_values($stats));
|
||||||
} catch (\Throwable $th) {
|
} catch (\Throwable $th) {
|
||||||
Console::error('Failed on project ("' . $project->getId() . '") version with error on File: ' . $th->getFile() . ' line no: ' . $th->getline() . ' with message: ' . $th->getMessage());
|
Console::error('Failed on project ("' . $project->getId() . '") version with error on File: ' . $th->getFile() . ' line no: ' . $th->getline() . ' with message: ' . $th->getMessage());
|
||||||
|
|
|
@ -149,6 +149,9 @@ class Hamster extends Action
|
||||||
/** Get Total Teams */
|
/** Get Total Teams */
|
||||||
$statsPerProject['custom_teams'] = $dbForProject->count('teams', [], APP_LIMIT_COUNT);
|
$statsPerProject['custom_teams'] = $dbForProject->count('teams', [], APP_LIMIT_COUNT);
|
||||||
|
|
||||||
|
/** Get Total Migrations */
|
||||||
|
$statsPerProject['custom_migrations'] = $dbForProject->count('migrations', [], APP_LIMIT_COUNT);
|
||||||
|
|
||||||
/** Get Total Members */
|
/** Get Total Members */
|
||||||
$teamInternalId = $project->getAttribute('teamInternalId', null);
|
$teamInternalId = $project->getAttribute('teamInternalId', null);
|
||||||
if ($teamInternalId) {
|
if ($teamInternalId) {
|
||||||
|
|
Loading…
Reference in a new issue