Commit d21b7a7
committed
common/pkg/cgroups: Replace handler interface with stat functions
Replace the controllerHandler interface with a simple statFunc type
and convert all handler structs to plain functions. This eliminates
unnecessary abstraction since all handlers only implemented a single
Stat method.
Changes:
- Replace controllerHandler interface with statFunc type
- Convert linuxBlkioHandler, linuxCPUHandler, linuxMemHandler, and
linuxPidHandler structs to blkioStat, cpuStat, memoryStat, and
pidsStat functions
- Remove init() function and factory methods (getBlkioHandler, etc.)
- Simplify handlers map to direct function references
- Update Stat() method to call functions directly
- Update AvailableControllers signature to use statFunc type
Signed-off-by: Lokesh Mandvekar <[email protected]>1 parent c0c9f9e commit d21b7a7
File tree
5 files changed
+18
-51
lines changed- common/pkg/cgroups
5 files changed
+18
-51
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 12 | + | |
| 13 | + | |
21 | 14 | | |
22 | 15 | | |
23 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 45 | + | |
| 46 | + | |
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| |||
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
70 | 65 | | |
71 | 66 | | |
72 | 67 | | |
| |||
95 | 90 | | |
96 | 91 | | |
97 | 92 | | |
98 | | - | |
| 93 | + | |
99 | 94 | | |
100 | 95 | | |
101 | 96 | | |
| |||
312 | 307 | | |
313 | 308 | | |
314 | 309 | | |
315 | | - | |
316 | | - | |
| 310 | + | |
| 311 | + | |
317 | 312 | | |
318 | 313 | | |
319 | 314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 11 | + | |
| 12 | + | |
20 | 13 | | |
21 | 14 | | |
22 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 11 | + | |
| 12 | + | |
20 | 13 | | |
21 | 14 | | |
22 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 11 | + | |
| 12 | + | |
20 | 13 | | |
21 | 14 | | |
22 | 15 | | |
| |||
0 commit comments