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

147 lines
5.1 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class UsageFunctions 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('functionsTotal', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated total statistics of functions.',
'default' => 0,
'example' => 0,
])
2023-10-25 09:46:45 +00:00
->addRule('deploymentsTotal', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated total statistics of function deployments.',
'default' => 0,
'example' => 0,
])
->addRule('deploymentsStorage', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated total statistics of function deployments storage.',
'default' => 0,
'example' => 0,
])
->addRule('buildsTotal', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated total statistics of function builds.',
'default' => 0,
'example' => 0,
])
->addRule('buildsStorage', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated total statistics of builds storage.',
'default' => 0,
'example' => 0,
])
->addRule('buildsTime', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated total statistics of build compute time.',
'default' => 0,
'example' => 0,
])
->addRule('executionsTotal', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated total statistics of functions executions.',
'default' => 0,
'example' => 0,
])
->addRule('executionsTime', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated total statistics of functions execution compute time.',
'default' => 0,
'example' => 0,
])
->addRule('functions', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated statistics of functions per period.',
'default' => 0,
'example' => 0,
'array' => true
])
->addRule('deployments', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated statistics of function deployments per period.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
2022-05-23 14:54:50 +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,
'description' => 'Aggregated statistics 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-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated statistics of function builds per period.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
'array' => true
])
2023-10-25 09:46:45 +00:00
->addRule('buildsStorage', [
2022-12-21 09:22:29 +00:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated statistics of builds storage per period.',
2022-12-21 09:22:29 +00:00
'default' => [],
'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,
'description' => 'Aggregated statistics of function build compute time per period.',
'default' => [],
2022-10-11 10:34:42 +00:00
'example' => [],
'array' => true
])
->addRule('executions', [
2022-10-11 10:34:42 +00:00
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated statistics of function executions per period.',
'default' => [],
2022-10-11 10:34:42 +00:00
'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,
'description' => 'Aggregated statistics of function execution compute time 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
])
;
}
/**
* Get Name
2022-05-23 14:54:50 +00:00
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getName(): string
{
return 'UsageFunctions';
}
/**
* Get Type
2022-05-23 14:54:50 +00:00
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getType(): string
{
return Response::MODEL_USAGE_FUNCTIONS;
}
2022-05-23 14:54:50 +00:00
}