Mercurial > archived > louis > perso > liblxcstats
comparison tests/span_containers.c @ 7:8339ab15527d
Add running/stopped containers global statistics and refactor some things
author | Louis Opter <louis@dotcloud.com> |
---|---|
date | Sat, 01 Jan 2011 17:46:40 +0100 |
parents | 6ce4443e7545 |
children |
comparison
equal
deleted
inserted
replaced
6:e2b88f50e136 | 7:8339ab15527d |
---|---|
21 } | 21 } |
22 | 22 |
23 int | 23 int |
24 main(int argc, char *argv[]) | 24 main(int argc, char *argv[]) |
25 { | 25 { |
26 lxcst_handle *hdl; | 26 lxcst_handle *hdl; |
27 struct lxcst_globals globals; | |
27 | 28 |
28 hdl = lxcst_open(); | 29 hdl = lxcst_open(); |
29 if (!hdl) | 30 if (!hdl) |
30 err(EXIT_FAILURE, "lxcst_open failed"); | 31 err(EXIT_FAILURE, "lxcst_open failed"); |
31 | 32 |
33 | 34 |
34 lxcst_close(hdl); | 35 lxcst_close(hdl); |
35 | 36 |
36 printf("%s: spanned %d containers.\n", *argv, n); | 37 printf("%s: spanned %d containers.\n", *argv, n); |
37 | 38 |
39 lxcst_globals_statistics(&globals); | |
40 | |
41 if (globals.running_containers != n) | |
42 errx(EXIT_FAILURE, "running_containers != spanned containers"); | |
43 | |
44 printf("%s: %d running containers, %d stopped containers.\n", *argv, globals.running_containers, globals.stopped_containers); | |
45 | |
38 return (EXIT_SUCCESS); | 46 return (EXIT_SUCCESS); |
39 (void)argc; | 47 (void)argc; |
40 } | 48 } |