beamlit 0.0.34rc58__py3-none-any.whl → 0.0.34rc59__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- beamlit/api/service_accounts/create_workspace_service_account.py +1 -3
- beamlit/api/service_accounts/delete_workspace_service_account.py +1 -3
- beamlit/api/service_accounts/get_workspace_service_accounts.py +1 -3
- beamlit/api/service_accounts/update_workspace_service_account.py +1 -3
- beamlit/models/__init__.py +13 -11
- beamlit/models/agent.py +21 -0
- beamlit/models/agent_spec.py +18 -0
- beamlit/models/core_event.py +79 -0
- beamlit/models/function.py +21 -0
- beamlit/models/increase_and_rate_metric.py +0 -9
- beamlit/models/integration_repository.py +88 -0
- beamlit/models/last_n_requests_metric.py +88 -0
- beamlit/models/latency_metric.py +45 -0
- beamlit/models/metric.py +18 -9
- beamlit/models/metrics.py +53 -53
- beamlit/models/model.py +21 -0
- beamlit/models/repository.py +70 -0
- beamlit/models/request_total_metric.py +88 -0
- beamlit/models/resource_environment_metrics.py +62 -82
- beamlit/models/workspace.py +7 -7
- {beamlit-0.0.34rc58.dist-info → beamlit-0.0.34rc59.dist-info}/METADATA +1 -1
- {beamlit-0.0.34rc58.dist-info → beamlit-0.0.34rc59.dist-info}/RECORD +23 -17
- {beamlit-0.0.34rc58.dist-info → beamlit-0.0.34rc59.dist-info}/WHEEL +0 -0
beamlit/models/metric.py
CHANGED
@@ -13,26 +13,32 @@ class Metric:
|
|
13
13
|
"""Metric
|
14
14
|
|
15
15
|
Attributes:
|
16
|
+
rate (Union[Unset, str]): Metric value
|
17
|
+
request_total (Union[Unset, str]): Metric value
|
16
18
|
timestamp (Union[Unset, str]): Metric timestamp
|
17
|
-
value (Union[Unset, str]): Metric value
|
18
19
|
"""
|
19
20
|
|
21
|
+
rate: Union[Unset, str] = UNSET
|
22
|
+
request_total: Union[Unset, str] = UNSET
|
20
23
|
timestamp: Union[Unset, str] = UNSET
|
21
|
-
value: Union[Unset, str] = UNSET
|
22
24
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
25
|
|
24
26
|
def to_dict(self) -> dict[str, Any]:
|
25
|
-
|
27
|
+
rate = self.rate
|
28
|
+
|
29
|
+
request_total = self.request_total
|
26
30
|
|
27
|
-
|
31
|
+
timestamp = self.timestamp
|
28
32
|
|
29
33
|
field_dict: dict[str, Any] = {}
|
30
34
|
field_dict.update(self.additional_properties)
|
31
35
|
field_dict.update({})
|
36
|
+
if rate is not UNSET:
|
37
|
+
field_dict["rate"] = rate
|
38
|
+
if request_total is not UNSET:
|
39
|
+
field_dict["requestTotal"] = request_total
|
32
40
|
if timestamp is not UNSET:
|
33
41
|
field_dict["timestamp"] = timestamp
|
34
|
-
if value is not UNSET:
|
35
|
-
field_dict["value"] = value
|
36
42
|
|
37
43
|
return field_dict
|
38
44
|
|
@@ -41,13 +47,16 @@ class Metric:
|
|
41
47
|
if not src_dict:
|
42
48
|
return None
|
43
49
|
d = src_dict.copy()
|
44
|
-
|
50
|
+
rate = d.pop("rate", UNSET)
|
51
|
+
|
52
|
+
request_total = d.pop("requestTotal", UNSET)
|
45
53
|
|
46
|
-
|
54
|
+
timestamp = d.pop("timestamp", UNSET)
|
47
55
|
|
48
56
|
metric = cls(
|
57
|
+
rate=rate,
|
58
|
+
request_total=request_total,
|
49
59
|
timestamp=timestamp,
|
50
|
-
value=value,
|
51
60
|
)
|
52
61
|
|
53
62
|
metric.additional_properties = d
|
beamlit/models/metrics.py
CHANGED
@@ -1,14 +1,10 @@
|
|
1
|
-
from typing import
|
1
|
+
from typing import Any, TypeVar, Union
|
2
2
|
|
3
3
|
from attrs import define as _attrs_define
|
4
4
|
from attrs import field as _attrs_field
|
5
5
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
|
-
if TYPE_CHECKING:
|
9
|
-
from ..models.increase_and_rate_metric import IncreaseAndRateMetric
|
10
|
-
|
11
|
-
|
12
8
|
T = TypeVar("T", bound="Metrics")
|
13
9
|
|
14
10
|
|
@@ -17,91 +13,95 @@ class Metrics:
|
|
17
13
|
"""Metrics for resources
|
18
14
|
|
19
15
|
Attributes:
|
16
|
+
agents (Union[Unset, Any]): Metrics for agents
|
17
|
+
functions (Union[Unset, Any]): Metrics for functions
|
20
18
|
inference_global (Union[Unset, Any]): Historical requests for all resources globally
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
models (Union[Unset, Any]): Metrics for models
|
20
|
+
request_total (Union[Unset, Any]): Number of requests for all resources globally
|
21
|
+
request_total_per_code (Union[Unset, Any]): Number of requests for all resources globally per code
|
22
|
+
rps (Union[Unset, Any]): Number of requests per second for all resources globally
|
23
|
+
rps_per_code (Union[Unset, Any]): Number of requests per second for all resources globally per code
|
25
24
|
"""
|
26
25
|
|
26
|
+
agents: Union[Unset, Any] = UNSET
|
27
|
+
functions: Union[Unset, Any] = UNSET
|
27
28
|
inference_global: Union[Unset, Any] = UNSET
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
models: Union[Unset, Any] = UNSET
|
30
|
+
request_total: Union[Unset, Any] = UNSET
|
31
|
+
request_total_per_code: Union[Unset, Any] = UNSET
|
32
|
+
rps: Union[Unset, Any] = UNSET
|
33
|
+
rps_per_code: Union[Unset, Any] = UNSET
|
32
34
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
33
35
|
|
34
36
|
def to_dict(self) -> dict[str, Any]:
|
37
|
+
agents = self.agents
|
38
|
+
|
39
|
+
functions = self.functions
|
40
|
+
|
35
41
|
inference_global = self.inference_global
|
36
42
|
|
37
|
-
|
43
|
+
models = self.models
|
44
|
+
|
45
|
+
request_total = self.request_total
|
38
46
|
|
39
|
-
|
40
|
-
if not isinstance(self.agents, Unset):
|
41
|
-
agents = self.agents.to_dict()
|
47
|
+
request_total_per_code = self.request_total_per_code
|
42
48
|
|
43
|
-
|
44
|
-
if not isinstance(self.functions, Unset):
|
45
|
-
functions = self.functions.to_dict()
|
49
|
+
rps = self.rps
|
46
50
|
|
47
|
-
|
48
|
-
if not isinstance(self.models, Unset):
|
49
|
-
models = self.models.to_dict()
|
51
|
+
rps_per_code = self.rps_per_code
|
50
52
|
|
51
53
|
field_dict: dict[str, Any] = {}
|
52
54
|
field_dict.update(self.additional_properties)
|
53
55
|
field_dict.update({})
|
54
|
-
if inference_global is not UNSET:
|
55
|
-
field_dict["inferenceGlobal"] = inference_global
|
56
|
-
if query is not UNSET:
|
57
|
-
field_dict["query"] = query
|
58
56
|
if agents is not UNSET:
|
59
57
|
field_dict["agents"] = agents
|
60
58
|
if functions is not UNSET:
|
61
59
|
field_dict["functions"] = functions
|
60
|
+
if inference_global is not UNSET:
|
61
|
+
field_dict["inferenceGlobal"] = inference_global
|
62
62
|
if models is not UNSET:
|
63
63
|
field_dict["models"] = models
|
64
|
+
if request_total is not UNSET:
|
65
|
+
field_dict["requestTotal"] = request_total
|
66
|
+
if request_total_per_code is not UNSET:
|
67
|
+
field_dict["requestTotalPerCode"] = request_total_per_code
|
68
|
+
if rps is not UNSET:
|
69
|
+
field_dict["rps"] = rps
|
70
|
+
if rps_per_code is not UNSET:
|
71
|
+
field_dict["rpsPerCode"] = rps_per_code
|
64
72
|
|
65
73
|
return field_dict
|
66
74
|
|
67
75
|
@classmethod
|
68
76
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
69
|
-
from ..models.increase_and_rate_metric import IncreaseAndRateMetric
|
70
|
-
|
71
77
|
if not src_dict:
|
72
78
|
return None
|
73
79
|
d = src_dict.copy()
|
80
|
+
agents = d.pop("agents", UNSET)
|
81
|
+
|
82
|
+
functions = d.pop("functions", UNSET)
|
83
|
+
|
74
84
|
inference_global = d.pop("inferenceGlobal", UNSET)
|
75
85
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
_functions = d.pop("functions", UNSET)
|
86
|
-
functions: Union[Unset, IncreaseAndRateMetric]
|
87
|
-
if isinstance(_functions, Unset):
|
88
|
-
functions = UNSET
|
89
|
-
else:
|
90
|
-
functions = IncreaseAndRateMetric.from_dict(_functions)
|
91
|
-
|
92
|
-
_models = d.pop("models", UNSET)
|
93
|
-
models: Union[Unset, IncreaseAndRateMetric]
|
94
|
-
if isinstance(_models, Unset):
|
95
|
-
models = UNSET
|
96
|
-
else:
|
97
|
-
models = IncreaseAndRateMetric.from_dict(_models)
|
86
|
+
models = d.pop("models", UNSET)
|
87
|
+
|
88
|
+
request_total = d.pop("requestTotal", UNSET)
|
89
|
+
|
90
|
+
request_total_per_code = d.pop("requestTotalPerCode", UNSET)
|
91
|
+
|
92
|
+
rps = d.pop("rps", UNSET)
|
93
|
+
|
94
|
+
rps_per_code = d.pop("rpsPerCode", UNSET)
|
98
95
|
|
99
96
|
metrics = cls(
|
100
|
-
inference_global=inference_global,
|
101
|
-
query=query,
|
102
97
|
agents=agents,
|
103
98
|
functions=functions,
|
99
|
+
inference_global=inference_global,
|
104
100
|
models=models,
|
101
|
+
request_total=request_total,
|
102
|
+
request_total_per_code=request_total_per_code,
|
103
|
+
rps=rps,
|
104
|
+
rps_per_code=rps_per_code,
|
105
105
|
)
|
106
106
|
|
107
107
|
metrics.additional_properties = d
|
beamlit/models/model.py
CHANGED
@@ -6,6 +6,7 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
+
from ..models.core_event import CoreEvent
|
9
10
|
from ..models.core_status import CoreStatus
|
10
11
|
from ..models.environment_metadata import EnvironmentMetadata
|
11
12
|
from ..models.model_spec import ModelSpec
|
@@ -19,17 +20,26 @@ class Model:
|
|
19
20
|
"""Logical object representing a model, that can be instantiated in multiple environments as model deployments
|
20
21
|
|
21
22
|
Attributes:
|
23
|
+
events (Union[Unset, list['CoreEvent']]): Core events
|
22
24
|
metadata (Union[Unset, EnvironmentMetadata]): Environment metadata
|
23
25
|
spec (Union[Unset, ModelSpec]): Model specification
|
24
26
|
status (Union[Unset, CoreStatus]): Core status
|
25
27
|
"""
|
26
28
|
|
29
|
+
events: Union[Unset, list["CoreEvent"]] = UNSET
|
27
30
|
metadata: Union[Unset, "EnvironmentMetadata"] = UNSET
|
28
31
|
spec: Union[Unset, "ModelSpec"] = UNSET
|
29
32
|
status: Union[Unset, "CoreStatus"] = UNSET
|
30
33
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
31
34
|
|
32
35
|
def to_dict(self) -> dict[str, Any]:
|
36
|
+
events: Union[Unset, list[dict[str, Any]]] = UNSET
|
37
|
+
if not isinstance(self.events, Unset):
|
38
|
+
events = []
|
39
|
+
for componentsschemas_core_events_item_data in self.events:
|
40
|
+
componentsschemas_core_events_item = componentsschemas_core_events_item_data.to_dict()
|
41
|
+
events.append(componentsschemas_core_events_item)
|
42
|
+
|
33
43
|
metadata: Union[Unset, dict[str, Any]] = UNSET
|
34
44
|
if not isinstance(self.metadata, Unset):
|
35
45
|
metadata = self.metadata.to_dict()
|
@@ -45,6 +55,8 @@ class Model:
|
|
45
55
|
field_dict: dict[str, Any] = {}
|
46
56
|
field_dict.update(self.additional_properties)
|
47
57
|
field_dict.update({})
|
58
|
+
if events is not UNSET:
|
59
|
+
field_dict["events"] = events
|
48
60
|
if metadata is not UNSET:
|
49
61
|
field_dict["metadata"] = metadata
|
50
62
|
if spec is not UNSET:
|
@@ -56,6 +68,7 @@ class Model:
|
|
56
68
|
|
57
69
|
@classmethod
|
58
70
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
71
|
+
from ..models.core_event import CoreEvent
|
59
72
|
from ..models.core_status import CoreStatus
|
60
73
|
from ..models.environment_metadata import EnvironmentMetadata
|
61
74
|
from ..models.model_spec import ModelSpec
|
@@ -63,6 +76,13 @@ class Model:
|
|
63
76
|
if not src_dict:
|
64
77
|
return None
|
65
78
|
d = src_dict.copy()
|
79
|
+
events = []
|
80
|
+
_events = d.pop("events", UNSET)
|
81
|
+
for componentsschemas_core_events_item_data in _events or []:
|
82
|
+
componentsschemas_core_events_item = CoreEvent.from_dict(componentsschemas_core_events_item_data)
|
83
|
+
|
84
|
+
events.append(componentsschemas_core_events_item)
|
85
|
+
|
66
86
|
_metadata = d.pop("metadata", UNSET)
|
67
87
|
metadata: Union[Unset, EnvironmentMetadata]
|
68
88
|
if isinstance(_metadata, Unset):
|
@@ -85,6 +105,7 @@ class Model:
|
|
85
105
|
status = CoreStatus.from_dict(_status)
|
86
106
|
|
87
107
|
model = cls(
|
108
|
+
events=events,
|
88
109
|
metadata=metadata,
|
89
110
|
spec=spec,
|
90
111
|
status=status,
|
@@ -0,0 +1,70 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="Repository")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class Repository:
|
13
|
+
"""Repository
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
type_ (Union[Unset, str]): Repository type
|
17
|
+
url (Union[Unset, str]): Repository URL
|
18
|
+
"""
|
19
|
+
|
20
|
+
type_: Union[Unset, str] = UNSET
|
21
|
+
url: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
type_ = self.type_
|
26
|
+
|
27
|
+
url = self.url
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if type_ is not UNSET:
|
33
|
+
field_dict["type"] = type_
|
34
|
+
if url is not UNSET:
|
35
|
+
field_dict["url"] = url
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
43
|
+
d = src_dict.copy()
|
44
|
+
type_ = d.pop("type", UNSET)
|
45
|
+
|
46
|
+
url = d.pop("url", UNSET)
|
47
|
+
|
48
|
+
repository = cls(
|
49
|
+
type_=type_,
|
50
|
+
url=url,
|
51
|
+
)
|
52
|
+
|
53
|
+
repository.additional_properties = d
|
54
|
+
return repository
|
55
|
+
|
56
|
+
@property
|
57
|
+
def additional_keys(self) -> list[str]:
|
58
|
+
return list(self.additional_properties.keys())
|
59
|
+
|
60
|
+
def __getitem__(self, key: str) -> Any:
|
61
|
+
return self.additional_properties[key]
|
62
|
+
|
63
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
64
|
+
self.additional_properties[key] = value
|
65
|
+
|
66
|
+
def __delitem__(self, key: str) -> None:
|
67
|
+
del self.additional_properties[key]
|
68
|
+
|
69
|
+
def __contains__(self, key: str) -> bool:
|
70
|
+
return key in self.additional_properties
|
@@ -0,0 +1,88 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="RequestTotalMetric")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class RequestTotalMetric:
|
13
|
+
"""Metrics for request total
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
request_total (Union[Unset, Any]): Number of requests for all resources globally
|
17
|
+
request_total_per_code (Union[Unset, Any]): Number of requests for all resources globally
|
18
|
+
rps (Union[Unset, Any]): Number of requests for all resources globally
|
19
|
+
rps_per_code (Union[Unset, Any]): Number of requests for all resources globally
|
20
|
+
"""
|
21
|
+
|
22
|
+
request_total: Union[Unset, Any] = UNSET
|
23
|
+
request_total_per_code: Union[Unset, Any] = UNSET
|
24
|
+
rps: Union[Unset, Any] = UNSET
|
25
|
+
rps_per_code: Union[Unset, Any] = UNSET
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
27
|
+
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
29
|
+
request_total = self.request_total
|
30
|
+
|
31
|
+
request_total_per_code = self.request_total_per_code
|
32
|
+
|
33
|
+
rps = self.rps
|
34
|
+
|
35
|
+
rps_per_code = self.rps_per_code
|
36
|
+
|
37
|
+
field_dict: dict[str, Any] = {}
|
38
|
+
field_dict.update(self.additional_properties)
|
39
|
+
field_dict.update({})
|
40
|
+
if request_total is not UNSET:
|
41
|
+
field_dict["requestTotal"] = request_total
|
42
|
+
if request_total_per_code is not UNSET:
|
43
|
+
field_dict["requestTotalPerCode"] = request_total_per_code
|
44
|
+
if rps is not UNSET:
|
45
|
+
field_dict["rps"] = rps
|
46
|
+
if rps_per_code is not UNSET:
|
47
|
+
field_dict["rpsPerCode"] = rps_per_code
|
48
|
+
|
49
|
+
return field_dict
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
53
|
+
if not src_dict:
|
54
|
+
return None
|
55
|
+
d = src_dict.copy()
|
56
|
+
request_total = d.pop("requestTotal", UNSET)
|
57
|
+
|
58
|
+
request_total_per_code = d.pop("requestTotalPerCode", UNSET)
|
59
|
+
|
60
|
+
rps = d.pop("rps", UNSET)
|
61
|
+
|
62
|
+
rps_per_code = d.pop("rpsPerCode", UNSET)
|
63
|
+
|
64
|
+
request_total_metric = cls(
|
65
|
+
request_total=request_total,
|
66
|
+
request_total_per_code=request_total_per_code,
|
67
|
+
rps=rps,
|
68
|
+
rps_per_code=rps_per_code,
|
69
|
+
)
|
70
|
+
|
71
|
+
request_total_metric.additional_properties = d
|
72
|
+
return request_total_metric
|
73
|
+
|
74
|
+
@property
|
75
|
+
def additional_keys(self) -> list[str]:
|
76
|
+
return list(self.additional_properties.keys())
|
77
|
+
|
78
|
+
def __getitem__(self, key: str) -> Any:
|
79
|
+
return self.additional_properties[key]
|
80
|
+
|
81
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
82
|
+
self.additional_properties[key] = value
|
83
|
+
|
84
|
+
def __delitem__(self, key: str) -> None:
|
85
|
+
del self.additional_properties[key]
|
86
|
+
|
87
|
+
def __contains__(self, key: str) -> bool:
|
88
|
+
return key in self.additional_properties
|
@@ -6,14 +6,8 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
+
from ..models.latency_metric import LatencyMetric
|
9
10
|
from ..models.metric import Metric
|
10
|
-
from ..models.qps import QPS
|
11
|
-
from ..models.resource_environment_metrics_inference_per_region import (
|
12
|
-
ResourceEnvironmentMetricsInferencePerRegion,
|
13
|
-
)
|
14
|
-
from ..models.resource_environment_metrics_query_per_region_per_code import (
|
15
|
-
ResourceEnvironmentMetricsQueryPerRegionPerCode,
|
16
|
-
)
|
17
11
|
|
18
12
|
|
19
13
|
T = TypeVar("T", bound="ResourceEnvironmentMetrics")
|
@@ -25,23 +19,21 @@ class ResourceEnvironmentMetrics:
|
|
25
19
|
|
26
20
|
Attributes:
|
27
21
|
inference_global (Union[Unset, list['Metric']]): Array of metrics
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
400) or per location
|
35
|
-
query_per_region_per_code (Union[Unset, ResourceEnvironmentMetricsQueryPerRegionPerCode]): Number of requests
|
36
|
-
done on the resource for the model deployment
|
22
|
+
last_n_requests (Union[Unset, list['Metric']]): Array of metrics
|
23
|
+
latency (Union[Unset, LatencyMetric]): Latency metrics
|
24
|
+
request_total (Union[Unset, Any]): Number of requests for the resource globally
|
25
|
+
request_total_per_code (Union[Unset, Any]): Number of requests for the resource globally per code
|
26
|
+
rps (Union[Unset, Any]): Number of requests per second for the resource globally
|
27
|
+
rps_per_code (Union[Unset, Any]): Number of requests per second for the resource globally per code
|
37
28
|
"""
|
38
29
|
|
39
30
|
inference_global: Union[Unset, list["Metric"]] = UNSET
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
31
|
+
last_n_requests: Union[Unset, list["Metric"]] = UNSET
|
32
|
+
latency: Union[Unset, "LatencyMetric"] = UNSET
|
33
|
+
request_total: Union[Unset, Any] = UNSET
|
34
|
+
request_total_per_code: Union[Unset, Any] = UNSET
|
35
|
+
rps: Union[Unset, Any] = UNSET
|
36
|
+
rps_per_code: Union[Unset, Any] = UNSET
|
45
37
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
46
38
|
|
47
39
|
def to_dict(self) -> dict[str, Any]:
|
@@ -52,52 +44,49 @@ class ResourceEnvironmentMetrics:
|
|
52
44
|
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
53
45
|
inference_global.append(componentsschemas_array_metric_item)
|
54
46
|
|
55
|
-
|
56
|
-
if not isinstance(self.
|
57
|
-
|
47
|
+
last_n_requests: Union[Unset, list[dict[str, Any]]] = UNSET
|
48
|
+
if not isinstance(self.last_n_requests, Unset):
|
49
|
+
last_n_requests = []
|
50
|
+
for componentsschemas_array_metric_item_data in self.last_n_requests:
|
51
|
+
componentsschemas_array_metric_item = componentsschemas_array_metric_item_data.to_dict()
|
52
|
+
last_n_requests.append(componentsschemas_array_metric_item)
|
53
|
+
|
54
|
+
latency: Union[Unset, dict[str, Any]] = UNSET
|
55
|
+
if not isinstance(self.latency, Unset):
|
56
|
+
latency = self.latency.to_dict()
|
58
57
|
|
59
|
-
|
58
|
+
request_total = self.request_total
|
60
59
|
|
61
|
-
|
62
|
-
if not isinstance(self.query_per_code_global, Unset):
|
63
|
-
query_per_code_global = self.query_per_code_global.to_dict()
|
60
|
+
request_total_per_code = self.request_total_per_code
|
64
61
|
|
65
|
-
|
66
|
-
if not isinstance(self.query_per_region, Unset):
|
67
|
-
query_per_region = self.query_per_region.to_dict()
|
62
|
+
rps = self.rps
|
68
63
|
|
69
|
-
|
70
|
-
if not isinstance(self.query_per_region_per_code, Unset):
|
71
|
-
query_per_region_per_code = self.query_per_region_per_code.to_dict()
|
64
|
+
rps_per_code = self.rps_per_code
|
72
65
|
|
73
66
|
field_dict: dict[str, Any] = {}
|
74
67
|
field_dict.update(self.additional_properties)
|
75
68
|
field_dict.update({})
|
76
69
|
if inference_global is not UNSET:
|
77
70
|
field_dict["inferenceGlobal"] = inference_global
|
78
|
-
if
|
79
|
-
field_dict["
|
80
|
-
if
|
81
|
-
field_dict["
|
82
|
-
if
|
83
|
-
field_dict["
|
84
|
-
if
|
85
|
-
field_dict["
|
86
|
-
if
|
87
|
-
field_dict["
|
71
|
+
if last_n_requests is not UNSET:
|
72
|
+
field_dict["lastNRequests"] = last_n_requests
|
73
|
+
if latency is not UNSET:
|
74
|
+
field_dict["latency"] = latency
|
75
|
+
if request_total is not UNSET:
|
76
|
+
field_dict["requestTotal"] = request_total
|
77
|
+
if request_total_per_code is not UNSET:
|
78
|
+
field_dict["requestTotalPerCode"] = request_total_per_code
|
79
|
+
if rps is not UNSET:
|
80
|
+
field_dict["rps"] = rps
|
81
|
+
if rps_per_code is not UNSET:
|
82
|
+
field_dict["rpsPerCode"] = rps_per_code
|
88
83
|
|
89
84
|
return field_dict
|
90
85
|
|
91
86
|
@classmethod
|
92
87
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
88
|
+
from ..models.latency_metric import LatencyMetric
|
93
89
|
from ..models.metric import Metric
|
94
|
-
from ..models.qps import QPS
|
95
|
-
from ..models.resource_environment_metrics_inference_per_region import (
|
96
|
-
ResourceEnvironmentMetricsInferencePerRegion,
|
97
|
-
)
|
98
|
-
from ..models.resource_environment_metrics_query_per_region_per_code import (
|
99
|
-
ResourceEnvironmentMetricsQueryPerRegionPerCode,
|
100
|
-
)
|
101
90
|
|
102
91
|
if not src_dict:
|
103
92
|
return None
|
@@ -109,45 +98,36 @@ class ResourceEnvironmentMetrics:
|
|
109
98
|
|
110
99
|
inference_global.append(componentsschemas_array_metric_item)
|
111
100
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
else:
|
117
|
-
inference_per_region = ResourceEnvironmentMetricsInferencePerRegion.from_dict(_inference_per_region)
|
101
|
+
last_n_requests = []
|
102
|
+
_last_n_requests = d.pop("lastNRequests", UNSET)
|
103
|
+
for componentsschemas_array_metric_item_data in _last_n_requests or []:
|
104
|
+
componentsschemas_array_metric_item = Metric.from_dict(componentsschemas_array_metric_item_data)
|
118
105
|
|
119
|
-
|
106
|
+
last_n_requests.append(componentsschemas_array_metric_item)
|
120
107
|
|
121
|
-
|
122
|
-
|
123
|
-
if isinstance(
|
124
|
-
|
108
|
+
_latency = d.pop("latency", UNSET)
|
109
|
+
latency: Union[Unset, LatencyMetric]
|
110
|
+
if isinstance(_latency, Unset):
|
111
|
+
latency = UNSET
|
125
112
|
else:
|
126
|
-
|
113
|
+
latency = LatencyMetric.from_dict(_latency)
|
127
114
|
|
128
|
-
|
129
|
-
query_per_region: Union[Unset, QPS]
|
130
|
-
if isinstance(_query_per_region, Unset):
|
131
|
-
query_per_region = UNSET
|
132
|
-
else:
|
133
|
-
query_per_region = QPS.from_dict(_query_per_region)
|
115
|
+
request_total = d.pop("requestTotal", UNSET)
|
134
116
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
query_per_region_per_code = ResourceEnvironmentMetricsQueryPerRegionPerCode.from_dict(
|
141
|
-
_query_per_region_per_code
|
142
|
-
)
|
117
|
+
request_total_per_code = d.pop("requestTotalPerCode", UNSET)
|
118
|
+
|
119
|
+
rps = d.pop("rps", UNSET)
|
120
|
+
|
121
|
+
rps_per_code = d.pop("rpsPerCode", UNSET)
|
143
122
|
|
144
123
|
resource_environment_metrics = cls(
|
145
124
|
inference_global=inference_global,
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
125
|
+
last_n_requests=last_n_requests,
|
126
|
+
latency=latency,
|
127
|
+
request_total=request_total,
|
128
|
+
request_total_per_code=request_total_per_code,
|
129
|
+
rps=rps,
|
130
|
+
rps_per_code=rps_per_code,
|
151
131
|
)
|
152
132
|
|
153
133
|
resource_environment_metrics.additional_properties = d
|