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

77 lines
2.3 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',
])
2021-10-26 13:19:28 +00:00
->addRule('functionsExecutions', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for function executions.',
'default' => [],
2022-05-23 14:54:50 +00:00
'example' => new \stdClass(),
'array' => true
])
2021-10-26 13:19:28 +00:00
->addRule('functionsFailures', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for function execution failures.',
'default' => [],
2022-05-23 14:54:50 +00:00
'example' => new \stdClass(),
'array' => true
])
2021-10-26 13:19:28 +00:00
->addRule('functionsCompute', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for function execution duration.',
'default' => [],
2022-05-23 14:54:50 +00:00
'example' => new \stdClass(),
'array' => true
])
2022-07-17 10:30:58 +00:00
->addRule('functionsExecutionTime', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for function execution duration.',
'default' => [],
'example' => new \stdClass(),
'array' => true
])
->addRule('functionsBuildTime', [
'type' => Response::MODEL_METRIC_LIST,
'description' => 'Aggregated stats for function execution duration.',
'default' => [],
'example' => new \stdClass(),
'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
}