Skip to content

Commit 33993f2

Browse files
authored
Document the usage of cgroup system metric providers (#1273)
* Fix links in READMEs of cgroup system metric providers * Document usage of cgroup name for metric provider -s argument * Add cgroup system metric providers to config example file * Add missing README for CpuTimeCgroupSystemProvider [skip ci]
1 parent 523c568 commit 33993f2

File tree

12 files changed

+45
-20
lines changed

12 files changed

+45
-20
lines changed

config.yml.example

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,34 @@ measurement:
148148
# sampling_rate: 99
149149
# memory.used.procfs.system.provider.MemoryUsedProcfsSystemProvider:
150150
# sampling_rate: 99
151+
#--- Cgroup system monitoring - These providers can be used to monitor background processes
151152
# cpu.utilization.cgroup.system.provider.CpuUtilizationCgroupSystemProvider:
152153
# sampling_rate: 99
153154
# cgroups:
154155
155156
# name: "Window Manager incl. X11"
156157
# "session-2.scope":
158+
# name: "GNOME Desktop"
159+
# memory.used.cgroup.system.provider.MemoryUsedCgroupSystemProvider:
160+
# sampling_rate: 99
161+
# cgroups:
162+
163+
# name: "Window Manager incl. X11"
164+
# "session-2.scope":
165+
# name: "GNOME Desktop"
166+
# disk.io.cgroup.system.provider.DiskIoCgroupSystemProvider:
167+
# sampling_rate: 99
168+
# cgroups:
169+
170+
# name: "Window Manager incl. X11"
171+
# "session-2.scope":
172+
# name: "GNOME Desktop"
173+
# network.io.cgroup.system.provider.NetworkIoCgroupSystemProvider:
174+
# sampling_rate: 99
175+
# cgroups:
176+
177+
# name: "Window Manager incl. X11"
178+
# "session-2.scope":
157179
# name: "GNOME Desktop"
158180

159181
#--- Architecture - MacOS

metric_providers/cpu/time/cgroup/container/source.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static void output_stats(container_t *containers, int length) {
5656

5757
static int parse_containers(container_t** containers, char* containers_string) {
5858
if(containers_string == NULL) {
59-
fprintf(stderr, "Please supply at least one container id with -s XXXX\n");
59+
fprintf(stderr, "Please supply at least one container id or cgroup name with -s XXXX\n");
6060
exit(1);
6161
}
6262

@@ -83,7 +83,7 @@ static int parse_containers(container_t** containers, char* containers_string) {
8383
}
8484

8585
if(length == 0) {
86-
fprintf(stderr, "Please supply at least one container id with -s XXXX\n");
86+
fprintf(stderr, "Please supply at least one container id or cgroup name with -s XXXX\n");
8787
exit(1);
8888
}
8989
return length;
@@ -129,7 +129,7 @@ int main(int argc, char **argv) {
129129
case 'h':
130130
printf("Usage: %s [-i msleep_time] [-h]\n\n",argv[0]);
131131
printf("\t-h : displays this help\n");
132-
printf("\t-s : string of container IDs separated by comma\n");
132+
printf("\t-s : string of container IDs or cgroup names separated by comma\n");
133133
printf("\t-i : specifies the milliseconds sleep time that will be slept between measurements\n");
134134
printf("\t-c : check system and exit\n");
135135
printf("\n");
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Documentation
2+
3+
Please see https://docs.green-coding.io/docs/measuring/metric-providers/cpu-time-cgroup-system/ for details
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Documentation
22

3-
Please see https://docs.green-coding.io/docs/measuring/metric-providers/cpu-utilization-cgroup-container-provider/ for details
3+
Please see https://docs.green-coding.io/docs/measuring/metric-providers/cpu-utilization-cgroup-container/ for details

metric_providers/cpu/utilization/cgroup/container/source.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static void output_stats(container_t* containers, int length) {
139139

140140
static int parse_containers(container_t** containers, char* containers_string) {
141141
if(containers_string == NULL) {
142-
fprintf(stderr, "Please supply at least one container id with -s XXXX\n");
142+
fprintf(stderr, "Please supply at least one container id or cgroup name with -s XXXX\n");
143143
exit(1);
144144
}
145145

@@ -166,7 +166,7 @@ static int parse_containers(container_t** containers, char* containers_string) {
166166
}
167167

168168
if(length == 0) {
169-
fprintf(stderr, "Please supply at least one container id with -s XXXX\n");
169+
fprintf(stderr, "Please supply at least one container id or cgroup name with -s XXXX\n");
170170
exit(1);
171171
}
172172

@@ -230,7 +230,7 @@ int main(int argc, char **argv) {
230230
case 'h':
231231
printf("Usage: %s [-i msleep_time] [-h]\n\n",argv[0]);
232232
printf("\t-h : displays this help\n");
233-
printf("\t-s : string of container IDs separated by comma\n");
233+
printf("\t-s : string of container IDs or cgroup names separated by comma\n");
234234
printf("\t-i : specifies the milliseconds sleep time that will be slept between measurements\n\n");
235235
printf("\t-c : check system and exit\n");
236236
printf("\n");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Documentation
22

3-
Please see https://docs.green-coding.io/docs/measuring/metric-providers/cpu-utilization-cgroup-system-provider/ for details
3+
Please see https://docs.green-coding.io/docs/measuring/metric-providers/cpu-utilization-cgroup-system/ for details

metric_providers/disk/io/cgroup/container/source.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static void output_stats(container_t *containers, int length) {
112112

113113
static int parse_containers(container_t** containers, char* containers_string) {
114114
if(containers_string == NULL) {
115-
fprintf(stderr, "Please supply at least one container id with -s XXXX\n");
115+
fprintf(stderr, "Please supply at least one container id or cgroup name with -s XXXX\n");
116116
exit(1);
117117
}
118118

@@ -140,7 +140,7 @@ static int parse_containers(container_t** containers, char* containers_string) {
140140
}
141141

142142
if(length == 0) {
143-
fprintf(stderr, "Please supply at least one container id with -s XXXX\n");
143+
fprintf(stderr, "Please supply at least one container id or cgroup name with -s XXXX\n");
144144
exit(1);
145145
}
146146
return length;
@@ -186,7 +186,7 @@ int main(int argc, char **argv) {
186186
case 'h':
187187
printf("Usage: %s [-i msleep_time] [-h]\n\n",argv[0]);
188188
printf("\t-h : displays this help\n");
189-
printf("\t-s : string of container IDs separated by comma\n");
189+
printf("\t-s : string of container IDs or cgroup names separated by comma\n");
190190
printf("\t-i : specifies the milliseconds sleep time that will be slept between measurements\n");
191191
printf("\t-c : check system and exit\n");
192192
printf("\n");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Documentation
22

3-
Please see https://docs.green-coding.io/docs/measuring/metric-providers/disk-io-cgroup-container/ for details
3+
Please see https://docs.green-coding.io/docs/measuring/metric-providers/disk-io-cgroup-system/ for details

metric_providers/memory/used/cgroup/container/source.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static void output_stats(container_t *containers, int length) {
115115

116116
static int parse_containers(container_t** containers, char* containers_string) {
117117
if(containers_string == NULL) {
118-
fprintf(stderr, "Please supply at least one container id with -s XXXX\n");
118+
fprintf(stderr, "Please supply at least one container id or cgroup name with -s XXXX\n");
119119
exit(1);
120120
}
121121

@@ -144,7 +144,7 @@ static int parse_containers(container_t** containers, char* containers_string) {
144144
}
145145

146146
if(length == 0) {
147-
fprintf(stderr, "Please supply at least one container id with -s XXXX\n");
147+
fprintf(stderr, "Please supply at least one container id or cgroup name with -s XXXX\n");
148148
exit(1);
149149
}
150150
return length;
@@ -190,7 +190,7 @@ int main(int argc, char **argv) {
190190
case 'h':
191191
printf("Usage: %s [-i msleep_time] [-h]\n\n",argv[0]);
192192
printf("\t-h : displays this help\n");
193-
printf("\t-s : string of container IDs separated by comma\n");
193+
printf("\t-s : string of container IDs or cgroup names separated by comma\n");
194194
printf("\t-i : specifies the milliseconds sleep time that will be slept between measurements\n");
195195
printf("\t-c : check system and exit\n");
196196
printf("\n");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Documentation
22

3-
Please see https://docs.green-coding.io/docs/measuring/metric-providers/memory-used-cgroup-container/ for details
3+
Please see https://docs.green-coding.io/docs/measuring/metric-providers/memory-used-cgroup-system/ for details

0 commit comments

Comments
 (0)