@@ -11,44 +11,70 @@ import {
1111} from './util.js' ;
1212
1313export class ResourceUsage {
14- constructor (
15- public readonly Capacity : number | bigint ,
16- public readonly RequestTotal : number | bigint ,
17- public readonly LimitTotal : number | bigint ,
18- ) { }
14+ public readonly Capacity : number | bigint ;
15+ public readonly RequestTotal : number | bigint ;
16+ public readonly LimitTotal : number | bigint ;
17+
18+ constructor ( Capacity : number | bigint , RequestTotal : number | bigint , LimitTotal : number | bigint ) {
19+ this . Capacity = Capacity ;
20+ this . RequestTotal = RequestTotal ;
21+ this . LimitTotal = LimitTotal ;
22+ }
1923}
2024
2125export class CurrentResourceUsage {
22- constructor (
23- public readonly CurrentUsage : number | bigint ,
24- public readonly RequestTotal : number | bigint ,
25- public readonly LimitTotal : number | bigint ,
26- ) { }
26+ public readonly CurrentUsage : number | bigint ;
27+ public readonly RequestTotal : number | bigint ;
28+ public readonly LimitTotal : number | bigint ;
29+
30+ constructor ( CurrentUsage : number | bigint , RequestTotal : number | bigint , LimitTotal : number | bigint ) {
31+ this . CurrentUsage = CurrentUsage ;
32+ this . RequestTotal = RequestTotal ;
33+ this . LimitTotal = LimitTotal ;
34+ }
2735}
2836
2937export class NodeStatus {
30- constructor (
31- public readonly Node : V1Node ,
32- public readonly CPU : ResourceUsage ,
33- public readonly Memory : ResourceUsage ,
34- ) { }
38+ public readonly Node : V1Node ;
39+ public readonly CPU : ResourceUsage ;
40+ public readonly Memory : ResourceUsage ;
41+
42+ constructor ( Node : V1Node , CPU : ResourceUsage , Memory : ResourceUsage ) {
43+ this . Node = Node ;
44+ this . CPU = CPU ;
45+ this . Memory = Memory ;
46+ }
3547}
3648
3749export class ContainerStatus {
38- constructor (
39- public readonly Container : string ,
40- public readonly CPUUsage : CurrentResourceUsage ,
41- public readonly MemoryUsage : CurrentResourceUsage ,
42- ) { }
50+ public readonly Container : string ;
51+ public readonly CPUUsage : CurrentResourceUsage ;
52+ public readonly MemoryUsage : CurrentResourceUsage ;
53+
54+ constructor ( Container : string , CPUUsage : CurrentResourceUsage , MemoryUsage : CurrentResourceUsage ) {
55+ this . Container = Container ;
56+ this . CPUUsage = CPUUsage ;
57+ this . MemoryUsage = MemoryUsage ;
58+ }
4359}
4460
4561export class PodStatus {
62+ public readonly Pod : V1Pod ;
63+ public readonly CPU : CurrentResourceUsage ;
64+ public readonly Memory : CurrentResourceUsage ;
65+ public readonly Containers : ContainerStatus [ ] ;
66+
4667 constructor (
47- public readonly Pod : V1Pod ,
48- public readonly CPU : CurrentResourceUsage ,
49- public readonly Memory : CurrentResourceUsage ,
50- public readonly Containers : ContainerStatus [ ] ,
51- ) { }
68+ Pod : V1Pod ,
69+ CPU : CurrentResourceUsage ,
70+ Memory : CurrentResourceUsage ,
71+ Containers : ContainerStatus [ ] ,
72+ ) {
73+ this . Pod = Pod ;
74+ this . CPU = CPU ;
75+ this . Memory = Memory ;
76+ this . Containers = Containers ;
77+ }
5278}
5379
5480export async function topNodes ( api : CoreV1Api ) : Promise < NodeStatus [ ] > {
0 commit comments