forked from jamespwilliams/psitop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenums.go
61 lines (54 loc) · 910 Bytes
/
enums.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
package main
type resource string
type pressureType string
type graphMetric int
const (
resourceAll resource = "all"
resourceCPU = "resourceCPU"
resourceMemory = "resourceMemory"
resourceIO = "resourceIO"
avg10 graphMetric = 10
avg60 graphMetric = 60
avg300 graphMetric = 300
some pressureType = "some"
full = "full"
both = "both"
)
func (k resource) tabIndex() int {
switch k {
case resourceAll:
return 0
case resourceCPU:
return 1
case resourceMemory:
return 2
case resourceIO:
return 3
default:
return -1
}
}
func (g graphMetric) tabIndex() int {
switch g {
case avg10:
return 0
case avg60:
return 1
case avg300:
return 2
default:
return -1
}
}
func (sf pressureType) tabIndex() int {
switch sf {
case some:
return 0
case full:
return 1
case both:
return 2
default:
return -1
}
}