@@ -45,30 +45,30 @@ func TestGrouperBasic(t *testing.T) {
45
45
}{
46
46
{
47
47
[]IDInfo {
48
- piinfost (p1 , n1 , Counts {1 , 2 , 3 , 4 , 5 , 6 , 0 , 0 }, Memory {7 , 8 , 0 , 0 , 0 },
48
+ piinfost (p1 , n1 , Counts {1 , 2 , 3 , 4 , 5 , 6 , 0 , 0 }, Memory {7 , 8 , 0 , 0 , 0 , 1 },
49
49
Filedesc {4 , 400 }, 2 , States {Other : 1 }),
50
- piinfost (p2 , n2 , Counts {2 , 3 , 4 , 5 , 6 , 7 , 0 , 0 }, Memory {8 , 9 , 0 , 0 , 0 },
50
+ piinfost (p2 , n2 , Counts {2 , 3 , 4 , 5 , 6 , 7 , 0 , 0 }, Memory {8 , 9 , 0 , 0 , 0 , 1 },
51
51
Filedesc {40 , 400 }, 3 , States {Waiting : 1 }),
52
52
},
53
53
GroupByName {
54
- "g1" : Group {Counts {}, States {Other : 1 }, msi {}, 1 , Memory {7 , 8 , 0 , 0 , 0 }, starttime ,
54
+ "g1" : Group {Counts {}, States {Other : 1 }, msi {}, 1 , Memory {7 , 8 , 0 , 0 , 0 , 1 }, starttime ,
55
55
4 , 0.01 , 2 , nil },
56
- "g2" : Group {Counts {}, States {Waiting : 1 }, msi {}, 1 , Memory {8 , 9 , 0 , 0 , 0 }, starttime ,
56
+ "g2" : Group {Counts {}, States {Waiting : 1 }, msi {}, 1 , Memory {8 , 9 , 0 , 0 , 0 , 1 }, starttime ,
57
57
40 , 0.1 , 3 , nil },
58
58
},
59
59
},
60
60
{
61
61
[]IDInfo {
62
62
piinfost (p1 , n1 , Counts {2 , 3 , 4 , 5 , 6 , 7 , 0 , 0 },
63
- Memory {6 , 7 , 0 , 0 , 0 }, Filedesc {100 , 400 }, 4 , States {Zombie : 1 }),
63
+ Memory {6 , 7 , 0 , 0 , 0 , 1 }, Filedesc {100 , 400 }, 4 , States {Zombie : 1 }),
64
64
piinfost (p2 , n2 , Counts {4 , 5 , 6 , 7 , 8 , 9 , 0 , 0 },
65
- Memory {9 , 8 , 0 , 0 , 0 }, Filedesc {400 , 400 }, 2 , States {Running : 1 }),
65
+ Memory {9 , 8 , 0 , 0 , 0 , 1 }, Filedesc {400 , 400 }, 2 , States {Running : 1 }),
66
66
},
67
67
GroupByName {
68
68
"g1" : Group {Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 }, States {Zombie : 1 }, msi {}, 1 ,
69
- Memory {6 , 7 , 0 , 0 , 0 }, starttime , 100 , 0.25 , 4 , nil },
69
+ Memory {6 , 7 , 0 , 0 , 0 , 1 }, starttime , 100 , 0.25 , 4 , nil },
70
70
"g2" : Group {Counts {2 , 2 , 2 , 2 , 2 , 2 , 0 , 0 }, States {Running : 1 }, msi {}, 1 ,
71
- Memory {9 , 8 , 0 , 0 , 0 }, starttime , 400 , 1 , 2 , nil },
71
+ Memory {9 , 8 , 0 , 0 , 0 , 1 }, starttime , 400 , 1 , 2 , nil },
72
72
},
73
73
},
74
74
}
@@ -95,35 +95,35 @@ func TestGrouperProcJoin(t *testing.T) {
95
95
}{
96
96
{
97
97
[]IDInfo {
98
- piinfo (p1 , n1 , Counts {1 , 2 , 3 , 4 , 5 , 6 , 0 , 0 }, Memory {3 , 4 , 0 , 0 , 0 }, Filedesc {4 , 400 }, 2 ),
98
+ piinfo (p1 , n1 , Counts {1 , 2 , 3 , 4 , 5 , 6 , 0 , 0 }, Memory {3 , 4 , 0 , 0 , 0 , 1 }, Filedesc {4 , 400 }, 2 ),
99
99
},
100
100
GroupByName {
101
- "g1" : Group {Counts {}, States {}, msi {}, 1 , Memory {3 , 4 , 0 , 0 , 0 }, starttime , 4 , 0.01 , 2 , nil },
101
+ "g1" : Group {Counts {}, States {}, msi {}, 1 , Memory {3 , 4 , 0 , 0 , 0 , 1 }, starttime , 4 , 0.01 , 2 , nil },
102
102
},
103
103
}, {
104
104
// The counts for pid2 won't be factored into the total yet because we only add
105
105
// to counts starting with the second time we see a proc. Memory and FDs are
106
106
// affected though.
107
107
[]IDInfo {
108
108
piinfost (p1 , n1 , Counts {3 , 4 , 5 , 6 , 7 , 8 , 0 , 0 },
109
- Memory {3 , 4 , 0 , 0 , 0 }, Filedesc {4 , 400 }, 2 , States {Running : 1 }),
109
+ Memory {3 , 4 , 0 , 0 , 0 , 1 }, Filedesc {4 , 400 }, 2 , States {Running : 1 }),
110
110
piinfost (p2 , n2 , Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 },
111
- Memory {1 , 2 , 0 , 0 , 0 }, Filedesc {40 , 400 }, 3 , States {Sleeping : 1 }),
111
+ Memory {1 , 2 , 0 , 0 , 0 , 1 }, Filedesc {40 , 400 }, 3 , States {Sleeping : 1 }),
112
112
},
113
113
GroupByName {
114
114
"g1" : Group {Counts {2 , 2 , 2 , 2 , 2 , 2 , 0 , 0 }, States {Running : 1 , Sleeping : 1 }, msi {}, 2 ,
115
- Memory {4 , 6 , 0 , 0 , 0 }, starttime , 44 , 0.1 , 5 , nil },
115
+ Memory {4 , 6 , 0 , 0 , 0 , 2 }, starttime , 44 , 0.1 , 5 , nil },
116
116
},
117
117
}, {
118
118
[]IDInfo {
119
119
piinfost (p1 , n1 , Counts {4 , 5 , 6 , 7 , 8 , 9 , 0 , 0 },
120
- Memory {1 , 5 , 0 , 0 , 0 }, Filedesc {4 , 400 }, 2 , States {Running : 1 }),
120
+ Memory {1 , 5 , 0 , 0 , 0 , 1 }, Filedesc {4 , 400 }, 2 , States {Running : 1 }),
121
121
piinfost (p2 , n2 , Counts {2 , 2 , 2 , 2 , 2 , 2 , 0 , 0 },
122
- Memory {2 , 4 , 0 , 0 , 0 }, Filedesc {40 , 400 }, 3 , States {Running : 1 }),
122
+ Memory {2 , 4 , 0 , 0 , 0 , 1 }, Filedesc {40 , 400 }, 3 , States {Running : 1 }),
123
123
},
124
124
GroupByName {
125
125
"g1" : Group {Counts {4 , 4 , 4 , 4 , 4 , 4 , 0 , 0 }, States {Running : 2 }, msi {}, 2 ,
126
- Memory {3 , 9 , 0 , 0 , 0 }, starttime , 44 , 0.1 , 5 , nil },
126
+ Memory {3 , 9 , 0 , 0 , 0 , 2 }, starttime , 44 , 0.1 , 5 , nil },
127
127
},
128
128
},
129
129
}
@@ -150,18 +150,18 @@ func TestGrouperNonDecreasing(t *testing.T) {
150
150
}{
151
151
{
152
152
[]IDInfo {
153
- piinfo (p1 , n1 , Counts {3 , 4 , 5 , 6 , 7 , 8 , 0 , 0 }, Memory {3 , 4 , 0 , 0 , 0 }, Filedesc {4 , 400 }, 2 ),
154
- piinfo (p2 , n2 , Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 }, Memory {1 , 2 , 0 , 0 , 0 }, Filedesc {40 , 400 }, 3 ),
153
+ piinfo (p1 , n1 , Counts {3 , 4 , 5 , 6 , 7 , 8 , 0 , 0 }, Memory {3 , 4 , 0 , 0 , 0 , 1 }, Filedesc {4 , 400 }, 2 ),
154
+ piinfo (p2 , n2 , Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 }, Memory {1 , 2 , 0 , 0 , 0 , 1 }, Filedesc {40 , 400 }, 3 ),
155
155
},
156
156
GroupByName {
157
- "g1" : Group {Counts {}, States {}, msi {}, 2 , Memory {4 , 6 , 0 , 0 , 0 }, starttime , 44 , 0.1 , 5 , nil },
157
+ "g1" : Group {Counts {}, States {}, msi {}, 2 , Memory {4 , 6 , 0 , 0 , 0 , 2 }, starttime , 44 , 0.1 , 5 , nil },
158
158
},
159
159
}, {
160
160
[]IDInfo {
161
- piinfo (p1 , n1 , Counts {4 , 5 , 6 , 7 , 8 , 9 , 0 , 0 }, Memory {1 , 5 , 0 , 0 , 0 }, Filedesc {4 , 400 }, 2 ),
161
+ piinfo (p1 , n1 , Counts {4 , 5 , 6 , 7 , 8 , 9 , 0 , 0 }, Memory {1 , 5 , 0 , 0 , 0 , 1 }, Filedesc {4 , 400 }, 2 ),
162
162
},
163
163
GroupByName {
164
- "g1" : Group {Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 }, States {}, msi {}, 1 , Memory {1 , 5 , 0 , 0 , 0 }, starttime , 4 , 0.01 , 2 , nil },
164
+ "g1" : Group {Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 }, States {}, msi {}, 1 , Memory {1 , 5 , 0 , 0 , 0 , 1 }, starttime , 4 , 0.01 , 2 , nil },
165
165
},
166
166
}, {
167
167
[]IDInfo {},
@@ -193,19 +193,19 @@ func TestGrouperRemoveEmptyGroups(t *testing.T) {
193
193
}{
194
194
{
195
195
[]IDInfo {
196
- piinfo (p1 , n1 , Counts {3 , 4 , 5 , 6 , 7 , 8 , 0 , 0 }, Memory {3 , 4 , 0 , 0 , 0 }, Filedesc {4 , 400 }, 2 ),
197
- piinfo (p2 , n2 , Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 }, Memory {1 , 2 , 0 , 0 , 0 }, Filedesc {40 , 400 }, 3 ),
196
+ piinfo (p1 , n1 , Counts {3 , 4 , 5 , 6 , 7 , 8 , 0 , 0 }, Memory {3 , 4 , 0 , 0 , 0 , 1 }, Filedesc {4 , 400 }, 2 ),
197
+ piinfo (p2 , n2 , Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 }, Memory {1 , 2 , 0 , 0 , 0 , 1 }, Filedesc {40 , 400 }, 3 ),
198
198
},
199
199
GroupByName {
200
- n1 : Group {Counts {}, States {}, msi {}, 1 , Memory {3 , 4 , 0 , 0 , 0 }, starttime , 4 , 0.01 , 2 , nil },
201
- n2 : Group {Counts {}, States {}, msi {}, 1 , Memory {1 , 2 , 0 , 0 , 0 }, starttime , 40 , 0.1 , 3 , nil },
200
+ n1 : Group {Counts {}, States {}, msi {}, 1 , Memory {3 , 4 , 0 , 0 , 0 , 1 }, starttime , 4 , 0.01 , 2 , nil },
201
+ n2 : Group {Counts {}, States {}, msi {}, 1 , Memory {1 , 2 , 0 , 0 , 0 , 1 }, starttime , 40 , 0.1 , 3 , nil },
202
202
},
203
203
}, {
204
204
[]IDInfo {
205
- piinfo (p1 , n1 , Counts {4 , 5 , 6 , 7 , 8 , 9 , 0 , 0 }, Memory {1 , 5 , 0 , 0 , 0 }, Filedesc {4 , 400 }, 2 ),
205
+ piinfo (p1 , n1 , Counts {4 , 5 , 6 , 7 , 8 , 9 , 0 , 0 }, Memory {1 , 5 , 0 , 0 , 0 , 1 }, Filedesc {4 , 400 }, 2 ),
206
206
},
207
207
GroupByName {
208
- n1 : Group {Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 }, States {}, msi {}, 1 , Memory {1 , 5 , 0 , 0 , 0 }, starttime , 4 , 0.01 , 2 , nil },
208
+ n1 : Group {Counts {1 , 1 , 1 , 1 , 1 , 1 , 0 , 0 }, States {}, msi {}, 1 , Memory {1 , 5 , 0 , 0 , 0 , 1 }, starttime , 4 , 0.01 , 2 , nil },
209
209
},
210
210
}, {
211
211
[]IDInfo {},
0 commit comments