mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-21 19:51:28 +00:00
refactor: Rename id to metric_id as some client caches values by id again
This commit is contained in:
parent
315250bae3
commit
5755fbba48
|
@ -22,7 +22,7 @@ class MonitoringValue:
|
|||
@strawberry.type
|
||||
@dataclass
|
||||
class MonitoringMetric:
|
||||
id: str
|
||||
metric_id: str
|
||||
values: List[MonitoringValue]
|
||||
|
||||
|
||||
|
@ -128,7 +128,7 @@ class MonitoringQueries:
|
|||
return list(
|
||||
map(
|
||||
lambda x: MonitoringMetric(
|
||||
id=MonitoringQueries._clean_slice_id(
|
||||
metric_id=MonitoringQueries._clean_slice_id(
|
||||
x["metric"][id_key], clean_id=clean_id
|
||||
),
|
||||
values=[
|
||||
|
@ -144,7 +144,7 @@ class MonitoringQueries:
|
|||
return list(
|
||||
map(
|
||||
lambda x: MonitoringMetric(
|
||||
id=MonitoringQueries._clean_slice_id(
|
||||
metric_id=MonitoringQueries._clean_slice_id(
|
||||
x["metric"][id_key], clean_id=clean_id
|
||||
),
|
||||
values=list(
|
||||
|
|
|
@ -60,7 +60,7 @@ query {
|
|||
|
||||
CPU_USAGE_QUERY_WITH_OPTIONS = """
|
||||
query Query($end: String!, $start: String!, $step: String!) {
|
||||
monitoring {
|
||||
monitoring {
|
||||
cpuUsage(end: $end, start: $start, step: $step) {
|
||||
end
|
||||
overallUsage {
|
||||
|
@ -88,7 +88,7 @@ query Query {
|
|||
averageUsageByService {
|
||||
... on MonitoringMetrics {
|
||||
metrics {
|
||||
id
|
||||
metricId
|
||||
values {
|
||||
timestamp
|
||||
value
|
||||
|
@ -103,7 +103,7 @@ query Query {
|
|||
maxUsageByService {
|
||||
... on MonitoringMetrics {
|
||||
metrics {
|
||||
id
|
||||
metricId
|
||||
values {
|
||||
timestamp
|
||||
value
|
||||
|
@ -134,12 +134,12 @@ query Query {
|
|||
|
||||
MEMORY_USAGE_QUERY_WITH_OPTIONS = """
|
||||
query Query($end: String!, $start: String!, $step: String!) {
|
||||
monitoring {
|
||||
monitoring {
|
||||
memoryUsage(end: $end, start: $start, step: $step) {
|
||||
averageUsageByService {
|
||||
... on MonitoringMetrics {
|
||||
metrics {
|
||||
id
|
||||
metricId
|
||||
values {
|
||||
timestamp
|
||||
value
|
||||
|
@ -154,7 +154,7 @@ query Query($end: String!, $start: String!, $step: String!) {
|
|||
maxUsageByService {
|
||||
... on MonitoringMetrics {
|
||||
metrics {
|
||||
id
|
||||
metricId
|
||||
values {
|
||||
timestamp
|
||||
value
|
||||
|
@ -193,7 +193,7 @@ query Query {
|
|||
overallUsage {
|
||||
... on MonitoringMetrics {
|
||||
metrics {
|
||||
id
|
||||
metricId
|
||||
values {
|
||||
timestamp
|
||||
value
|
||||
|
@ -211,13 +211,13 @@ query Query {
|
|||
|
||||
NETWORK_USAGE_QUERY_WITH_OPTIONS = """
|
||||
query Query($end: String!, $start: String!, $step: String!) {
|
||||
monitoring {
|
||||
monitoring {
|
||||
networkUsage(end: $end, start: $start, step: $step) {
|
||||
end
|
||||
overallUsage {
|
||||
... on MonitoringMetrics {
|
||||
metrics {
|
||||
id
|
||||
metricId
|
||||
values {
|
||||
timestamp
|
||||
value
|
||||
|
@ -246,7 +246,7 @@ query Query {
|
|||
overallUsage {
|
||||
... on MonitoringMetrics {
|
||||
metrics {
|
||||
id
|
||||
metricId
|
||||
values {
|
||||
timestamp
|
||||
value
|
||||
|
@ -270,7 +270,7 @@ query Query($end: String!, $start: String!, $step: String!) {
|
|||
overallUsage {
|
||||
... on MonitoringMetrics {
|
||||
metrics {
|
||||
id
|
||||
metricId
|
||||
values {
|
||||
timestamp
|
||||
value
|
||||
|
|
Loading…
Reference in a new issue