Add scope to GraphQL Metric Type

This commit is contained in:
Jan Eitzinger 2023-03-24 14:43:37 +01:00
parent c622967d27
commit 4d49698e5a
3 changed files with 4 additions and 1 deletions

View File

@ -108,6 +108,7 @@ type Resource {
type JobMetricWithName { type JobMetricWithName {
name: String! name: String!
scope: MetricScope!
metric: JobMetric! metric: JobMetric!
} }

View File

@ -59,6 +59,7 @@ type JobFilter struct {
type JobMetricWithName struct { type JobMetricWithName struct {
Name string `json:"name"` Name string `json:"name"`
Scope schema.MetricScope `json:"scope"`
Metric *schema.JobMetric `json:"metric"` Metric *schema.JobMetric `json:"metric"`
} }

View File

@ -173,9 +173,10 @@ func (r *queryResolver) JobMetrics(ctx context.Context, id string, metrics []str
res := []*model.JobMetricWithName{} res := []*model.JobMetricWithName{}
for name, md := range data { for name, md := range data {
for _, metric := range md { for scope, metric := range md {
res = append(res, &model.JobMetricWithName{ res = append(res, &model.JobMetricWithName{
Name: name, Name: name,
Scope: scope,
Metric: metric, Metric: metric,
}) })
} }