add table to compareview, remove debug data view

This commit is contained in:
Christoph Kluge
2025-05-08 15:21:05 +02:00
parent c119eeb468
commit 9ebc49dd1c
5 changed files with 136 additions and 25 deletions

View File

@@ -173,6 +173,7 @@ type ComplexityRoot struct {
JobStats struct {
Cluster func(childComplexity int) int
Duration func(childComplexity int) int
ID func(childComplexity int) int
JobID func(childComplexity int) int
NumAccelerators func(childComplexity int) int
NumHWThreads func(childComplexity int) int
@@ -961,6 +962,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.JobStats.Duration(childComplexity), true
case "JobStats.id":
if e.complexity.JobStats.ID == nil {
break
}
return e.complexity.JobStats.ID(childComplexity), true
case "JobStats.jobId":
if e.complexity.JobStats.JobID == nil {
break
@@ -2336,7 +2344,8 @@ type ScopedStats {
}
type JobStats {
jobId: Int!
id: Int!
jobId: String!
startTime: Int!
duration: Int!
cluster: String!
@@ -7419,6 +7428,50 @@ func (ec *executionContext) fieldContext_JobResultList_hasNextPage(_ context.Con
return fc, nil
}
func (ec *executionContext) _JobStats_id(ctx context.Context, field graphql.CollectedField, obj *model.JobStats) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_JobStats_id(ctx, field)
if err != nil {
return graphql.Null
}
ctx = graphql.WithFieldContext(ctx, fc)
defer func() {
if r := recover(); r != nil {
ec.Error(ctx, ec.Recover(ctx, r))
ret = graphql.Null
}
}()
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
ctx = rctx // use context from middleware stack in children
return obj.ID, nil
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
if !graphql.HasFieldError(ctx, fc) {
ec.Errorf(ctx, "must not be null")
}
return graphql.Null
}
res := resTmp.(int)
fc.Result = res
return ec.marshalNInt2int(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_JobStats_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "JobStats",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Int does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _JobStats_jobId(ctx context.Context, field graphql.CollectedField, obj *model.JobStats) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_JobStats_jobId(ctx, field)
if err != nil {
@@ -7445,9 +7498,9 @@ func (ec *executionContext) _JobStats_jobId(ctx context.Context, field graphql.C
}
return graphql.Null
}
res := resTmp.(int)
res := resTmp.(string)
fc.Result = res
return ec.marshalNInt2int(ctx, field.Selections, res)
return ec.marshalNString2string(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_JobStats_jobId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
@@ -7457,7 +7510,7 @@ func (ec *executionContext) fieldContext_JobStats_jobId(_ context.Context, field
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type Int does not have child fields")
return nil, errors.New("field of type String does not have child fields")
},
}
return fc, nil
@@ -11560,6 +11613,8 @@ func (ec *executionContext) fieldContext_Query_jobsMetricStats(ctx context.Conte
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_JobStats_id(ctx, field)
case "jobId":
return ec.fieldContext_JobStats_jobId(ctx, field)
case "startTime":
@@ -17901,6 +17956,11 @@ func (ec *executionContext) _JobStats(ctx context.Context, sel ast.SelectionSet,
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("JobStats")
case "id":
out.Values[i] = ec._JobStats_id(ctx, field, obj)
if out.Values[i] == graphql.Null {
out.Invalids++
}
case "jobId":
out.Values[i] = ec._JobStats_jobId(ctx, field, obj)
if out.Values[i] == graphql.Null {

View File

@@ -97,7 +97,8 @@ type JobResultList struct {
}
type JobStats struct {
JobID int `json:"jobId"`
ID int `json:"id"`
JobID string `json:"jobId"`
StartTime int `json:"startTime"`
Duration int `json:"duration"`
Cluster string `json:"cluster"`

View File

@@ -618,7 +618,8 @@ func (r *queryResolver) JobsMetricStats(ctx context.Context, filter []*model.Job
numThreadsInt := int(job.NumHWThreads)
numAccsInt := int(job.NumAcc)
res = append(res, &model.JobStats{
JobID: int(job.JobID),
ID: int(job.ID),
JobID: strconv.Itoa(int(job.JobID)),
StartTime: int(job.StartTime.Unix()),
Duration: int(job.Duration),
Cluster: job.Cluster,