refactor: Rename id to metric_id as some client caches values by id again

This commit is contained in:
Inex Code 2024-07-30 06:56:46 +03:00
parent 315250bae3
commit 5755fbba48
2 changed files with 14 additions and 14 deletions

View file

@ -22,7 +22,7 @@ class MonitoringValue:
@strawberry.type @strawberry.type
@dataclass @dataclass
class MonitoringMetric: class MonitoringMetric:
id: str metric_id: str
values: List[MonitoringValue] values: List[MonitoringValue]
@ -128,7 +128,7 @@ class MonitoringQueries:
return list( return list(
map( map(
lambda x: MonitoringMetric( lambda x: MonitoringMetric(
id=MonitoringQueries._clean_slice_id( metric_id=MonitoringQueries._clean_slice_id(
x["metric"][id_key], clean_id=clean_id x["metric"][id_key], clean_id=clean_id
), ),
values=[ values=[
@ -144,7 +144,7 @@ class MonitoringQueries:
return list( return list(
map( map(
lambda x: MonitoringMetric( lambda x: MonitoringMetric(
id=MonitoringQueries._clean_slice_id( metric_id=MonitoringQueries._clean_slice_id(
x["metric"][id_key], clean_id=clean_id x["metric"][id_key], clean_id=clean_id
), ),
values=list( values=list(

View file

@ -88,7 +88,7 @@ query Query {
averageUsageByService { averageUsageByService {
... on MonitoringMetrics { ... on MonitoringMetrics {
metrics { metrics {
id metricId
values { values {
timestamp timestamp
value value
@ -103,7 +103,7 @@ query Query {
maxUsageByService { maxUsageByService {
... on MonitoringMetrics { ... on MonitoringMetrics {
metrics { metrics {
id metricId
values { values {
timestamp timestamp
value value
@ -139,7 +139,7 @@ query Query($end: String!, $start: String!, $step: String!) {
averageUsageByService { averageUsageByService {
... on MonitoringMetrics { ... on MonitoringMetrics {
metrics { metrics {
id metricId
values { values {
timestamp timestamp
value value
@ -154,7 +154,7 @@ query Query($end: String!, $start: String!, $step: String!) {
maxUsageByService { maxUsageByService {
... on MonitoringMetrics { ... on MonitoringMetrics {
metrics { metrics {
id metricId
values { values {
timestamp timestamp
value value
@ -193,7 +193,7 @@ query Query {
overallUsage { overallUsage {
... on MonitoringMetrics { ... on MonitoringMetrics {
metrics { metrics {
id metricId
values { values {
timestamp timestamp
value value
@ -217,7 +217,7 @@ query Query($end: String!, $start: String!, $step: String!) {
overallUsage { overallUsage {
... on MonitoringMetrics { ... on MonitoringMetrics {
metrics { metrics {
id metricId
values { values {
timestamp timestamp
value value
@ -246,7 +246,7 @@ query Query {
overallUsage { overallUsage {
... on MonitoringMetrics { ... on MonitoringMetrics {
metrics { metrics {
id metricId
values { values {
timestamp timestamp
value value
@ -270,7 +270,7 @@ query Query($end: String!, $start: String!, $step: String!) {
overallUsage { overallUsage {
... on MonitoringMetrics { ... on MonitoringMetrics {
metrics { metrics {
id metricId
values { values {
timestamp timestamp
value value