-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmetrics.go
107 lines (92 loc) · 2.29 KB
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
package schema
import (
"entgo.io/contrib/entgql"
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
)
// Metrics holds the schema definition for the Metrics entity.
type Metrics struct {
ent.Schema
}
// Fields of the Metrics struct.
func (Metrics) Fields() []ent.Field {
return []ent.Field{}
}
// Edges of the Metrics.
func (Metrics) Edges() []ent.Edge {
return []ent.Edge{
// Edge back to the bazel invocation.
edge.From("bazel_invocation", BazelInvocation.Type).
Ref("metrics").
Unique(),
// The action summmary with details about actions executed.
edge.To("action_summary", ActionSummary.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Details about memory usage and garbage collections.
edge.To("memory_metrics", MemoryMetrics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Target metrics.
edge.To("target_metrics", TargetMetrics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Package metrics.
edge.To("package_metrics", PackageMetrics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Timing metrics.
edge.To("timing_metrics", TimingMetrics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Cumulative metrics.
edge.To("cumulative_metrics", CumulativeMetrics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Artifact metrics.
edge.To("artifact_metrics", ArtifactMetrics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Network metrics if available.
edge.To("network_metrics", NetworkMetrics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Dynamic execution metrics if available.
edge.To("dynamic_execution_metrics", DynamicExecutionMetrics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Build graph metrics.
edge.To("build_graph_metrics", BuildGraphMetrics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
}
}
// Annotations of the Metrics.
func (Metrics) Annotations() []schema.Annotation {
return []schema.Annotation{
entgql.RelayConnection(),
entgql.QueryField("findMetrics"),
}
}