-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathactioncachestatistics.go
51 lines (43 loc) · 1.44 KB
/
actioncachestatistics.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
package schema
import (
"entgo.io/ent"
"entgo.io/ent/dialect/entsql"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// ActionCacheStatistics holds the schema definition for the ActionCacheStatistics entity.
type ActionCacheStatistics struct {
ent.Schema
}
// Fields of the ActionCacheStatistics.
func (ActionCacheStatistics) Fields() []ent.Field {
return []ent.Field{
// Size of the action cache in bytes.
// This is computed by the code that persists the action cache to disk and
// represents the size of the written files, which has no direct relation to
// the number of entries in the cache.
field.Uint64("size_in_bytes").Optional(),
// Time it took to save the action cache to disk.
field.Uint64("save_time_in_ms").Optional(),
// Time it took to load the action cache from disk. Reported as 0 if the
// action cache has not been loaded in this invocation.
field.Int64("load_time_in_ms").Optional(),
// Cache counters.
field.Int32("hits").Optional(),
field.Int32("misses").Optional(),
}
}
// Edges of the ActionCacheStatistics.
func (ActionCacheStatistics) Edges() []ent.Edge {
return []ent.Edge{
// Edge back to the associated action summary.
edge.From("action_summary", ActionSummary.Type).
Ref("action_cache_statistics").
Unique(),
// Breakdown of the cache misses based on the reasons behind them.
edge.To("miss_details", MissDetail.Type).
Annotations(
entsql.OnDelete(entsql.Cascade),
),
}
}