Repository navigation
Expand file tree
/
Copy pathContainerMemoryStats.php
More file actions
291 lines (261 loc) · 7.74 KB
/
Copy pathContainerMemoryStats.php
File metadata and controls
291 lines (261 loc) · 7.74 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<?php
declare(strict_types=1);
namespace Docker\API\Model;
use Docker\API\Runtime\AdditionalAndPatternProperties;
use Docker\API\Runtime\AdditionalPropertiesInterface;
class ContainerMemoryStats implements AdditionalPropertiesInterface
{
use AdditionalAndPatternProperties;
/**
* @var array
*/
protected $initialized = [];
public function isInitialized($property): bool
{
return \array_key_exists($property, $this->initialized);
}
/**
* Current `res_counter` usage for memory.
*
* This field is Linux-specific and omitted for Windows containers.
*
* @var int|null
*/
protected $usage;
/**
* Maximum usage ever recorded.
*
* This field is Linux-specific and only supported on cgroups v1.
* It is omitted when using cgroups v2 and for Windows containers.
*
* @var int|null
*/
protected $maxUsage;
/**
* All the stats exported via memory.stat.
*
* The fields in this object differ between cgroups v1 and v2.
* On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available.
* On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available.
*
* This field is Linux-specific and omitted for Windows containers.
*
* @var array<string, int>|null
*/
protected $stats;
/**
* Number of times memory usage hits limits.
*
* This field is Linux-specific and only supported on cgroups v1.
* It is omitted when using cgroups v2 and for Windows containers.
*
* @var int|null
*/
protected $failcnt;
/**
* This field is Linux-specific and omitted for Windows containers.
*
* @var int|null
*/
protected $limit;
/**
* Committed bytes.
*
* This field is Windows-specific and omitted for Linux containers.
*
* @var int|null
*/
protected $commitbytes;
/**
* Peak committed bytes.
*
* This field is Windows-specific and omitted for Linux containers.
*
* @var int|null
*/
protected $commitpeakbytes;
/**
* Private working set.
*
* This field is Windows-specific and omitted for Linux containers.
*
* @var int|null
*/
protected $privateworkingset;
/**
* Current `res_counter` usage for memory.
*
* This field is Linux-specific and omitted for Windows containers.
*/
public function getUsage(): ?int
{
return $this->usage;
}
/**
* Current `res_counter` usage for memory.
*
* This field is Linux-specific and omitted for Windows containers.
*/
public function setUsage(?int $usage): self
{
$this->initialized['usage'] = true;
$this->usage = $usage;
return $this;
}
/**
* Maximum usage ever recorded.
*
* This field is Linux-specific and only supported on cgroups v1.
* It is omitted when using cgroups v2 and for Windows containers.
*/
public function getMaxUsage(): ?int
{
return $this->maxUsage;
}
/**
* Maximum usage ever recorded.
*
* This field is Linux-specific and only supported on cgroups v1.
* It is omitted when using cgroups v2 and for Windows containers.
*/
public function setMaxUsage(?int $maxUsage): self
{
$this->initialized['maxUsage'] = true;
$this->maxUsage = $maxUsage;
return $this;
}
/**
* All the stats exported via memory.stat.
*
* The fields in this object differ between cgroups v1 and v2.
* On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available.
* On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available.
*
* This field is Linux-specific and omitted for Windows containers.
*
* @return array<string, int>|null
*/
public function getStats(): ?iterable
{
return $this->stats;
}
/**
* All the stats exported via memory.stat.
*
* The fields in this object differ between cgroups v1 and v2.
* On cgroups v1, fields such as `cache`, `rss`, `mapped_file` are available.
* On cgroups v2, fields such as `file`, `anon`, `inactive_file` are available.
*
* This field is Linux-specific and omitted for Windows containers.
*
* @param array<string, int>|null $stats
*/
public function setStats(?iterable $stats): self
{
$this->initialized['stats'] = true;
$this->stats = $stats;
return $this;
}
/**
* Number of times memory usage hits limits.
*
* This field is Linux-specific and only supported on cgroups v1.
* It is omitted when using cgroups v2 and for Windows containers.
*/
public function getFailcnt(): ?int
{
return $this->failcnt;
}
/**
* Number of times memory usage hits limits.
*
* This field is Linux-specific and only supported on cgroups v1.
* It is omitted when using cgroups v2 and for Windows containers.
*/
public function setFailcnt(?int $failcnt): self
{
$this->initialized['failcnt'] = true;
$this->failcnt = $failcnt;
return $this;
}
/**
* This field is Linux-specific and omitted for Windows containers.
*/
public function getLimit(): ?int
{
return $this->limit;
}
/**
* This field is Linux-specific and omitted for Windows containers.
*/
public function setLimit(?int $limit): self
{
$this->initialized['limit'] = true;
$this->limit = $limit;
return $this;
}
/**
* Committed bytes.
*
* This field is Windows-specific and omitted for Linux containers.
*/
public function getCommitbytes(): ?int
{
return $this->commitbytes;
}
/**
* Committed bytes.
*
* This field is Windows-specific and omitted for Linux containers.
*/
public function setCommitbytes(?int $commitbytes): self
{
$this->initialized['commitbytes'] = true;
$this->commitbytes = $commitbytes;
return $this;
}
/**
* Peak committed bytes.
*
* This field is Windows-specific and omitted for Linux containers.
*/
public function getCommitpeakbytes(): ?int
{
return $this->commitpeakbytes;
}
/**
* Peak committed bytes.
*
* This field is Windows-specific and omitted for Linux containers.
*/
public function setCommitpeakbytes(?int $commitpeakbytes): self
{
$this->initialized['commitpeakbytes'] = true;
$this->commitpeakbytes = $commitpeakbytes;
return $this;
}
/**
* Private working set.
*
* This field is Windows-specific and omitted for Linux containers.
*/
public function getPrivateworkingset(): ?int
{
return $this->privateworkingset;
}
/**
* Private working set.
*
* This field is Windows-specific and omitted for Linux containers.
*/
public function setPrivateworkingset(?int $privateworkingset): self
{
$this->initialized['privateworkingset'] = true;
$this->privateworkingset = $privateworkingset;
return $this;
}
public function definedProperties(): array
{
return ['usage' => ['usage', 'getUsage', 'setUsage'], 'maxUsage' => ['max_usage', 'getMaxUsage', 'setMaxUsage'], 'stats' => ['stats', 'getStats', 'setStats'], 'failcnt' => ['failcnt', 'getFailcnt', 'setFailcnt'], 'limit' => ['limit', 'getLimit', 'setLimit'], 'commitbytes' => ['commitbytes', 'getCommitbytes', 'setCommitbytes'], 'commitpeakbytes' => ['commitpeakbytes', 'getCommitpeakbytes', 'setCommitpeakbytes'], 'privateworkingset' => ['privateworkingset', 'getPrivateworkingset', 'setPrivateworkingset']];
}
}