summaryrefslogtreecommitdiffstats
path: root/examples/stats.rs
diff options
context:
space:
mode:
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);
+ }
+ }
+}