sync with 1.4

This commit is contained in:
shimon
2023-10-04 17:40:16 +03:00
parent f528656d61
commit 499eb0c3de
5 changed files with 17 additions and 17 deletions
+2
View File
@@ -1678,6 +1678,8 @@ App::post('/v1/functions/:functionId/executions')
* Sync execution compute usage from
*/
$queueForUsage
->addMetric(METRIC_EXECUTIONS, 1)
->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS), 1)
->addMetric(METRIC_EXECUTIONS_COMPUTE, (int)($executionResponse['duration'] * 1000)) // per project
->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS_COMPUTE), (int)($executionResponse['duration'] * 1000)) // per function
;
+3 -7
View File
@@ -130,13 +130,7 @@ Server::setResource('execute', function () {
throw new Exception('Failed to create or read execution');
}
/**
* Usage
*/
$queueForUsage
->addMetric(METRIC_EXECUTIONS, 1) // per project
->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS), 1); // per function
}
if ($execution->getAttribute('status') !== 'processing') {
@@ -289,7 +283,9 @@ Server::setResource('execute', function () {
/** Trigger usage queue */
$queueForUsage
->setProject($project)
->addMetric(METRIC_EXECUTIONS_COMPUTE, (int)($execution->getAttribute('duration') * 1000))// per project
->addMetric(METRIC_EXECUTIONS, 1)
->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS), 1)
->addMetric(METRIC_EXECUTIONS_COMPUTE, (int)($execution->getAttribute('duration') * 1000))
->addMetric(str_replace('{functionInternalId}', $function->getInternalId(), METRIC_FUNCTION_ID_EXECUTIONS_COMPUTE), (int)($execution->getAttribute('duration') * 1000))
->trigger()
;
Generated
+10 -8
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "3e554f27be84931c1db939809a45feff",
"content-hash": "8c487168571ef67391005a55d93ad801",
"packages": [
{
"name": "adhocore/jwt",
@@ -2269,16 +2269,16 @@
},
{
"name": "utopia-php/storage",
"version": "0.14.0",
"version": "0.17.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/storage.git",
"reference": "eda6651ac16884dc2a79ecb984ea591ba1ed498c"
"reference": "efec5376c02d3d8330f1beb1469e6d6e313e21ee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/storage/zipball/eda6651ac16884dc2a79ecb984ea591ba1ed498c",
"reference": "eda6651ac16884dc2a79ecb984ea591ba1ed498c",
"url": "https://api.github.com/repos/utopia-php/storage/zipball/efec5376c02d3d8330f1beb1469e6d6e313e21ee",
"reference": "efec5376c02d3d8330f1beb1469e6d6e313e21ee",
"shasum": ""
},
"require": {
@@ -2286,10 +2286,12 @@
"ext-fileinfo": "*",
"ext-lz4": "*",
"ext-snappy": "*",
"ext-xz": "*",
"ext-zlib": "*",
"ext-zstd": "*",
"php": ">=8.0",
"utopia-php/framework": "0.*.*"
"utopia-php/framework": "0.*.*",
"utopia-php/system": "0.*.*"
},
"require-dev": {
"laravel/pint": "1.2.*",
@@ -2316,9 +2318,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/storage/issues",
"source": "https://github.com/utopia-php/storage/tree/0.14.0"
"source": "https://github.com/utopia-php/storage/tree/0.17.0"
},
"time": "2023-03-15T00:16:34+00:00"
"time": "2023-08-21T11:28:36+00:00"
},
{
"name": "utopia-php/swoole",
+1 -1
View File
@@ -113,7 +113,7 @@ class Executor
) {
$timeout = (int) App::getEnv('_APP_FUNCTIONS_BUILD_TIMEOUT', 900);
$runtimeId = "$projectId-$deploymentId-build";
$runtimeId = "$projectId-$deploymentId";
$route = "/runtimes/{$runtimeId}/logs";
$params = [
'timeout' => $timeout