github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-stats.1.md.in (about)

     1  % podman-stats 1
     2  
     3  ## NAME
     4  podman\-stats - Display a live stream of one or more container's resource usage statistics
     5  
     6  ## SYNOPSIS
     7  **podman stats** [*options*] [*container*]
     8  
     9  **podman container stats** [*options*] [*container*]
    10  
    11  ## DESCRIPTION
    12  Display a live stream of one or more containers' resource usage statistics
    13  
    14  Note:  Podman stats does not work in rootless environments that use CGroups V1.
    15  Podman stats relies on CGroup information for statistics, and CGroup v1 is not
    16  supported for rootless use cases.
    17  
    18  Note: Rootless environments that use CGroups V2 are not able to report statistics
    19  about their networking usage.
    20  
    21  ## OPTIONS
    22  
    23  #### **--all**, **-a**
    24  
    25  Show all containers.  Only running containers are shown by default
    26  
    27  #### **--format**=*template*
    28  
    29  Pretty-print container statistics to JSON or using a Go template
    30  
    31  Valid placeholders for the Go template are listed below:
    32  
    33  | **Placeholder**     | **Description**                                  |
    34  |---------------------|--------------------------------------------------|
    35  | .AvgCPU             | Average CPU, full precision float                |
    36  | .AVGCPU             | Average CPU, formatted as a percent              |
    37  | .BlockInput         | Total data read from block device                |
    38  | .BlockIO            | Total data read/total data written to block device|
    39  | .BlockOutput        | Total data written to block device               |
    40  | .ContainerID        | Container ID, full (untruncated) hash            |
    41  | .ContainerStats ... | Nested structure, for experts only               |
    42  | .CPU                | Percent CPU, full precision float                |
    43  | .CPUNano            | CPU Usage, total, in nanoseconds                 |
    44  | .CPUPerc            | Percentage of CPU used                           |
    45  | .CPUSystemNano      | CPU Usage, kernel, in nanoseconds                |
    46  | .Duration           | Same as CPUNano                                  |
    47  | .ID                 | Container ID, truncated                          |
    48  | .MemLimit           | Memory limit, in bytes                           |
    49  | .MemPerc            | Memory percentage used                           |
    50  | .MemUsage           | Memory usage                                     |
    51  | .MemUsageBytes      | Memory usage (IEC)                               |
    52  | .Name               | Container Name                                   |
    53  | .NetIO              | Network IO                                       |
    54  | .Network ...        | Network I/O, separated by network interface      |
    55  | .PerCPU             | CPU time consumed by all tasks [1]               |
    56  | .PIDs               | Number of PIDs                                   |
    57  | .PIDS               | Number of PIDs (yes, we know this is a dup)      |
    58  | .SystemNano         | Current system datetime, nanoseconds since epoch |
    59  | .Up                 | Duration (CPUNano), in human-readable form       |
    60  | .UpTime             | Same as Up                                       |
    61  
    62  [1] Cgroups V1 only
    63  
    64  When using a Go template, precede the format with `table` to print headers.
    65  
    66  #### **--interval**, **-i**=*seconds*
    67  
    68  Time in seconds between stats reports, defaults to 5 seconds.
    69  
    70  @@option latest
    71  
    72  @@option no-reset
    73  
    74  @@option no-stream
    75  
    76  #### **--no-trunc**
    77  
    78  Do not truncate output
    79  
    80  ## EXAMPLE
    81  
    82  List statistics about all running containers without streaming mode:
    83  ```
    84  # podman stats -a --no-stream
    85  ID             NAME              CPU %   MEM USAGE / LIMIT   MEM %   NET IO    BLOCK IO   PIDS
    86  a9f807ffaacd   frosty_hodgkin    --      3.092MB / 16.7GB    0.02%   -- / --   -- / --    2
    87  3b33001239ee   sleepy_stallman   --      -- / --             --      -- / --   -- / --    --
    88  ```
    89  
    90  List the specified container's statistics in streaming mode:
    91  ```
    92  # podman stats a9f80
    93  ID             NAME             CPU %   MEM USAGE / LIMIT   MEM %   NET IO    BLOCK IO   PIDS
    94  a9f807ffaacd   frosty_hodgkin   --      3.092MB / 16.7GB    0.02%   -- / --   -- / --    2
    95  ```
    96  
    97  List the specified statistics about the specified container in table format:
    98  ```
    99  $ podman stats --no-trunc 3667 --format 'table {{ .ID }} {{ .MemUsage }}'
   100  ID                                                                MEM USAGE / LIMIT
   101  3667c6aacb06aac2eaffce914c01736420023d56ef9b0f4cfe58b6d6a78b7503  49.15kB / 67.17GB
   102  ```
   103  
   104  List the specified container statistics in JSON format:
   105  ```
   106  # podman stats --no-stream --format=json a9f80
   107  [
   108      {
   109  	"id": "a9f807ffaacd",
   110  	"name": "frosty_hodgkin",
   111  	"cpu_percent": "--",
   112  	"mem_usage": "3.092MB / 16.7GB",
   113  	"mem_percent": "0.02%",
   114  	"netio": "-- / --",
   115  	"blocki": "-- / --",
   116  	"pids": "2"
   117      }
   118  ]
   119  ```
   120  
   121  List the specified container statistics in table format:
   122  ```
   123  # podman stats --no-stream --format "table {{.ID}} {{.Name}} {{.MemUsage}}" 6eae
   124  ID             NAME           MEM USAGE / LIMIT
   125  6eae9e25a564   clever_bassi   3.031MB / 16.7GB
   126  ```
   127  
   128  Note: When using a slirp4netns network with the rootlesskit port
   129  handler, the traffic sent via the port forwarding is accounted to
   130  the `lo` device.  Traffic accounted to `lo` is not accounted in the
   131  stats output.
   132  
   133  
   134  ## SEE ALSO
   135  **[podman(1)](podman.1.md)**
   136  
   137  ## HISTORY
   138  July 2017, Originally compiled by Ryan Cole <rycole@redhat.com>