diff --git a/app/workers/builds.php b/app/workers/builds.php index 9145808b6c..ced0a84113 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -56,6 +56,11 @@ class BuildsV1 extends Worker } } + /** + * @throws \Utopia\Database\Exception\Authorization + * @throws \Utopia\Database\Exception\Structure + * @throws Throwable + */ protected function buildDeployment(Document $project, Document $function, Document $deployment) { global $register; @@ -171,8 +176,8 @@ class BuildsV1 extends Worker try { $response = $this->executor->createRuntime( - projectId: $project->getId(), deploymentId: $deployment->getId(), + projectId: $project->getId(), source: $source, image: $runtime['image'], remove: true, @@ -256,10 +261,10 @@ class BuildsV1 extends Worker ->setProject($project) ->addMetric(METRIC_BUILDS, 1) // per project ->addMetric(METRIC_BUILDS_STORAGE, $build->getAttribute('size', 0)) - ->addMetric(METRIC_BUILDS_COMPUTE, $build->getAttribute('duration', 0)) + ->addMetric(METRIC_BUILDS_COMPUTE, (int)$build->getAttribute('duration', 0) * 1000) ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS), 1) // per function ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS_STORAGE), $build->getAttribute('size', 0)) - ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS_COMPUTE), $build->getAttribute('duration', 0)) + ->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_BUILDS_COMPUTE), (int)$build->getAttribute('duration', 0) * 1000) ->trigger() ; } diff --git a/composer.lock b/composer.lock index 2e7ffda63a..b810568d97 100644 --- a/composer.lock +++ b/composer.lock @@ -1452,12 +1452,12 @@ "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "ba9f0cea086fa7a8b4b613ef4afe41196fd7b4d1" + "reference": "e548c4b5c6f1d7cfc9ba0113fbeb8c4684eddcd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/ba9f0cea086fa7a8b4b613ef4afe41196fd7b4d1", - "reference": "ba9f0cea086fa7a8b4b613ef4afe41196fd7b4d1", + "url": "https://api.github.com/repos/utopia-php/database/zipball/e548c4b5c6f1d7cfc9ba0113fbeb8c4684eddcd2", + "reference": "e548c4b5c6f1d7cfc9ba0113fbeb8c4684eddcd2", "shasum": "" }, "require": { @@ -1499,7 +1499,7 @@ "issues": "https://github.com/utopia-php/database/issues", "source": "https://github.com/utopia-php/database/tree/increment" }, - "time": "2023-02-02T08:34:12+00:00" + "time": "2023-02-05T10:33:42+00:00" }, { "name": "utopia-php/domains",