summaryrefslogtreecommitdiffstats
path: root/examples/stats.rs
diff options
context:
space:
mode:
authorsoftprops <d.tangren@gmail.com>2016-01-03 11:10:00 -0500
committersoftprops <d.tangren@gmail.com>2016-01-03 11:10:00 -0500
commit69b96bb4fd3e41e06a4afc10a06997eacc23cd84 (patch)
tree3e3296284dd2456d67dcb4f9ee07067a51cea65c /examples/stats.rs
parent614d0763f638279c776e67a656ff1cf2b2a4c8d8 (diff)
more bin to examples
Diffstat (limited to 'examples/stats.rs')
-rw-r--r--examples/stats.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/examples/stats.rs b/examples/stats.rs
new file mode 100644
index 0000000..9a0f38d
--- /dev/null
+++ b/examples/stats.rs
@@ -0,0 +1,15 @@
+extern crate shiplift;
+
+use shiplift::Docker;
+use std::env;
+
+fn main() {
+ let docker = Docker::new();
+ let containers = docker.containers();
+ if let Some(id) = env::args().nth(1) {
+ let stats = containers.get(&id).stats();
+ for s in stats.unwrap() {
+ println!("{:?}", s);
+ }
+ }
+}