@@ -514,6 +514,94 @@ Status Codes:
514514- ** 404** – no such container
515515- ** 500** – server error
516516
517+ ### Get container stats based on resource usage
518+
519+ ` GET /containers/(id)/stats `
520+
521+ Returns a stream of json objects of the container's stats
522+
523+ ** Example request** :
524+
525+ GET /containers/redis1/stats HTTP/1.1
526+
527+ ** Example response** :
528+
529+ HTTP/1.1 200 OK
530+ Content-Type: application/json
531+
532+ {
533+ "read" : "2015-01-08T22:57:31.547920715Z",
534+ "network" : {
535+ "rx_dropped" : 0,
536+ "rx_bytes" : 648,
537+ "rx_errors" : 0,
538+ "tx_packets" : 8,
539+ "tx_dropped" : 0,
540+ "rx_packets" : 8,
541+ "tx_errors" : 0,
542+ "tx_bytes" : 648
543+ },
544+ "memory_stats" : {
545+ "stats" : {
546+ "total_pgmajfault" : 0,
547+ "cache" : 0,
548+ "mapped_file" : 0,
549+ "total_inactive_file" : 0,
550+ "pgpgout" : 414,
551+ "rss" : 6537216,
552+ "total_mapped_file" : 0,
553+ "writeback" : 0,
554+ "unevictable" : 0,
555+ "pgpgin" : 477,
556+ "total_unevictable" : 0,
557+ "pgmajfault" : 0,
558+ "total_rss" : 6537216,
559+ "total_rss_huge" : 6291456,
560+ "total_writeback" : 0,
561+ "total_inactive_anon" : 0,
562+ "rss_huge" : 6291456,
563+ "hierarchical_memory_limit" : 67108864,
564+ "total_pgfault" : 964,
565+ "total_active_file" : 0,
566+ "active_anon" : 6537216,
567+ "total_active_anon" : 6537216,
568+ "total_pgpgout" : 414,
569+ "total_cache" : 0,
570+ "inactive_anon" : 0,
571+ "active_file" : 0,
572+ "pgfault" : 964,
573+ "inactive_file" : 0,
574+ "total_pgpgin" : 477
575+ },
576+ "max_usage" : 6651904,
577+ "usage" : 6537216,
578+ "failcnt" : 0,
579+ "limit" : 67108864
580+ },
581+ "blkio_stats" : {},
582+ "cpu_stats" : {
583+ "cpu_usage" : {
584+ "percpu_usage" : [
585+ 16970827,
586+ 1839451,
587+ 7107380,
588+ 10571290
589+ ],
590+ "usage_in_usermode" : 10000000,
591+ "total_usage" : 36488948,
592+ "usage_in_kernelmode" : 20000000
593+ },
594+ "system_cpu_usage" : 20091722000000000,
595+ "throttling_data" : {}
596+ }
597+ }
598+
599+ Status Codes:
600+
601+ - ** 200** – no error
602+ - ** 404** – no such container
603+ - ** 500** – server error
604+
517605### Resize a container TTY
518606
519607` POST /containers/(id)/resize?h=<height>&w=<width> `
0 commit comments