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

153 lines
5.4 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class UsageProject extends Model
{
public function __construct()
{
$this
2023-10-25 09:46:45 +00:00
->addRule('executionsTotal', [
2023-11-08 09:09:32 +00:00
'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,
])
2023-10-25 09:46:45 +00:00
->addRule('documentsTotal', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated number of documents.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2023-10-25 09:46:45 +00:00
->addRule('databasesTotal', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated number of databases.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2023-10-25 09:46:45 +00:00
->addRule('usersTotal', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated number of users.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2023-11-08 09:09:32 +00:00
->addRule('filesStorageTotal', [
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated sum of files storage size (in bytes).',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
->addRule('functionsStorageTotal', [
'type' => self::TYPE_INTEGER,
'description' => 'Total aggregated sum of functions storage size (in bytes).',
'default' => 0,
'example' => 0,
])
2023-10-25 09:46:45 +00:00
->addRule('bucketsTotal', [
2023-11-08 09:09:32 +00:00
'type' => self::TYPE_INTEGER,
2023-11-09 10:54:33 +00:00
'description' => 'Total aggregated number of buckets.',
2023-11-08 09:09:32 +00:00
'default' => 0,
'example' => 0,
])
2024-07-30 08:53:28 +00:00
->addRule('executionsMbSecondsTotal', [
'type' => self::TYPE_INTEGER,
'description' => 'Total aggregated number of function executions mbSeconds.',
'default' => 0,
'example' => 0,
])
->addRule('buildsMbSecondsTotal', [
'type' => self::TYPE_INTEGER,
'description' => 'Total aggregated number of function builds mbSeconds.',
'default' => 0,
'example' => 0,
])
2023-11-08 16:12:36 +00:00
->addRule('requests', [
2023-12-11 15:19:08 +00:00
'type' => Response::MODEL_METRIC,
2023-11-09 10:54:33 +00:00
'description' => 'Aggregated number of requests per period.',
2023-11-08 16:12:36 +00:00
'default' => [],
'example' => [],
'array' => true
])
->addRule('network', [
2023-12-11 15:19:08 +00:00
'type' => Response::MODEL_METRIC,
2023-11-09 10:54:33 +00:00
'description' => 'Aggregated number of consumed bandwidth per period.',
2023-11-08 16:12:36 +00:00
'default' => [],
'example' => [],
'array' => true
])
2023-12-11 15:19:08 +00:00
->addRule('users', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated number of users per period.',
'default' => [],
'example' => [],
'array' => true
])
->addRule('executions', [
'type' => Response::MODEL_METRIC,
'description' => 'Aggregated number of executions per period.',
'default' => [],
2023-12-11 15:19:08 +00:00
'example' => [],
'array' => true
])
->addRule('executionsBreakdown', [
'type' => Response::MODEL_METRIC_BREAKDOWN,
'description' => 'Aggregated breakdown in totals of executions by functions.',
'default' => [],
'example' => [],
'array' => true
])
->addRule('bucketsBreakdown', [
'type' => Response::MODEL_METRIC_BREAKDOWN,
'description' => 'Aggregated breakdown in totals of usage by buckets.',
'default' => [],
'example' => [],
'array' => true
])
2024-07-30 08:53:28 +00:00
->addRule('executionsMbSecondsBreakdown', [
'type' => Response::MODEL_METRIC_BREAKDOWN,
'description' => 'Aggregated breakdown in totals of execution mbSeconds by functions.',
'default' => [],
'example' => [],
'array' => true
])
->addRule('buildsMbSecondsBreakdown', [
'type' => Response::MODEL_METRIC_BREAKDOWN,
'description' => 'Aggregated breakdown in totals of build mbSeconds by functions.',
'default' => [],
'example' => [],
'array' => true
])
->addRule('functionsStorageBreakdown', [
'type' => Response::MODEL_METRIC_BREAKDOWN,
'description' => 'Aggregated breakdown in totals of functions storage size (in bytes).',
'default' => [],
'example' => [],
'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 'UsageProject';
}
/**
* 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_PROJECT;
}
2022-05-23 14:54:50 +00:00
}