-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathactionsummary.go
68 lines (58 loc) · 2.22 KB
/
actionsummary.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
package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// ActionSummary holds the schema definition for the ActionSummary entity.
type ActionSummary struct {
ent.Schema
}
// Fields of the ActionSummary.
func (ActionSummary) Fields() []ent.Field {
return []ent.Field{
// The total number of actions created and registered during the build,
// including both aspects and configured targets. This metric includes
// unused actions that were constructed but not executed during this build.
// It does not include actions that were created on prior builds that are
// still valid, even if those actions had to be re-executed on this build.
// For the total number of actions that would be created if this invocation
// were "clean", see BuildGraphMetrics below.
field.Int64("actions_created").Optional(),
// The total number of actions created this build just by configured
// targets. Used mainly to allow consumers of actions_created, which used to
// not include aspects' actions, to normalize across the Blaze release that
// switched actions_created to include all created actions.
field.Int64("actions_created_not_including_aspects").Optional(),
// The total number of actions executed during the build. This includes any
// remote cache hits, but excludes local action cache hits.
field.Int64("actions_executed").Optional(),
// Deprecated. The total number of remote cache hits.
field.Int64("remote_cache_hits").Optional(),
}
}
// Edges of the ActionSummary.
func (ActionSummary) Edges() []ent.Edge {
return []ent.Edge{
edge.From("metrics", Metrics.Type).
Ref("action_summary").
Unique(),
// Contains the top N actions by number of actions executed.
edge.To("action_data", ActionData.Type).
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Count of which Runner types were executed which actions.
edge.To("runner_count", RunnerCount.Type).
Annotations(
entsql.OnDelete(entsql.Cascade),
),
// Information about the action cache behavior during a single invocation.
edge.To("action_cache_statistics", ActionCacheStatistics.Type).
Unique().
Annotations(
entsql.OnDelete(entsql.Cascade),
),
}
}