appwrite/src/Appwrite/Utopia/Response/Model/UsageFunction.php

134 lines
4.5 KiB
PHP
Raw Normal View History

2022-07-17 10:30:58 +00:00
<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class UsageFunction extends Model
{
public function __construct()
{
$this
->addRule('range', [
'type' => self::TYPE_STRING,
'description' => 'The time range of the usage stats.',
'default' => '',
'example' => '30d',
])
2023-10-25 09:46:45 +00:00
->addRule('deploymentsTotal', [
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated number of function deployments.',
'default' => 0,
'example' => 0,
])
->addRule('deploymentsStorageTotal', [
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated sum of function deployments storage.',
'default' => 0,
'example' => 0,
])
->addRule('buildsTotal', [
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated number of function builds.',
'default' => 0,
'example' => 0,
])
->addRule('buildsStorageTotal', [
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'total aggregated sum of function builds storage.',
'default' => 0,
'example' => 0,
])
->addRule('buildsTimeTotal', [
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated sum of function builds compute time.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
->addRule('executionsTotal', [
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated number of function executions.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
->addRule('executionsTimeTotal', [
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated sum of function executions compute time.',
'default' => 0,
'example' => 0,
])
->addRule('deployments', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2023-11-09 10:54:33 +00:00
'description' => 'Aggregated number of function deployments per period.',
2022-07-17 10:30:58 +00:00
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-07-17 10:30:58 +00:00
'array' => true
])
2023-10-25 09:46:45 +00:00
->addRule('deploymentsStorage', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2023-11-09 10:54:33 +00:00
'description' => 'Aggregated number of function deployments storage per period.',
2022-07-17 10:30:58 +00:00
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-07-17 10:30:58 +00:00
'array' => true
])
->addRule('builds', [
2022-12-21 09:22:29 +00:00
'type' => Response::MODEL_METRIC,
2023-11-09 10:54:33 +00:00
'description' => 'Aggregated number of function builds per period.',
2022-12-21 09:22:29 +00:00
'default' => [],
'example' => [],
'array' => true
])
2023-10-25 09:46:45 +00:00
->addRule('buildsStorage', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2023-11-09 10:54:33 +00:00
'description' => 'Aggregated sum of function builds storage per period.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
'array' => true
])
2023-10-25 09:46:45 +00:00
->addRule('buildsTime', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2023-11-09 10:54:33 +00:00
'description' => 'Aggregated sum of function builds compute time per period.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
'array' => true
])
->addRule('executions', [
2023-08-20 15:40:05 +00:00
'type' => Response::MODEL_METRIC,
2023-11-09 10:54:33 +00:00
'description' => 'Aggregated number of function executions per period.',
2023-08-20 15:40:05 +00:00
'default' => [],
'example' => [],
'array' => true
])
2023-10-25 09:46:45 +00:00
->addRule('executionsTime', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
2023-11-09 10:54:33 +00:00
'description' => 'Aggregated number of function executions compute time per period.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
'array' => true
])
2022-07-17 10:30:58 +00:00
;
}
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
return 'UsageFunction';
}
/**
* Get Type
*
* @return string
*/
public function getType(): string
{
return Response::MODEL_USAGE_FUNCTION;
}
}