Skip to content

Commit 44edcf3

Browse files
committed
fmt; gen
1 parent eb2bcf6 commit 44edcf3

File tree

5 files changed

+44
-7
lines changed

5 files changed

+44
-7
lines changed

cli/clistat/container.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ import (
99
"golang.org/x/xerrors"
1010
)
1111

12-
const procMounts = "/proc/mounts"
13-
const procOneCgroup = "/proc/1/cgroup"
12+
const (
13+
procMounts = "/proc/mounts"
14+
procOneCgroup = "/proc/1/cgroup"
15+
)
1416

1517
// IsContainerized returns whether the host is containerized.
1618
// This is adapted from https://github.com/elastic/go-sysinfo/tree/main/providers/linux/container.go#L31

cli/stat.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ func (*RootCmd) stat() *clibase.Cmd {
1818
// If running in a container, we assume that users want to see these first. Prepend.
1919
defaultCols = append([]string{"container_cpu", "container_memory"}, defaultCols...)
2020
}
21-
var (
22-
formatter = cliui.NewOutputFormatter(
23-
cliui.TableFormat([]statsRow{}, defaultCols),
24-
cliui.JSONFormat(),
25-
)
21+
formatter := cliui.NewOutputFormatter(
22+
cliui.TableFormat([]statsRow{}, defaultCols),
23+
cliui.JSONFormat(),
2624
)
2725

2826
cmd := &clibase.Cmd{

docs/cli.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr
4949
| [<code>speedtest</code>](./cli/speedtest.md) | Run upload and download tests from your machine to a workspace |
5050
| [<code>ssh</code>](./cli/ssh.md) | Start a shell into a workspace |
5151
| [<code>start</code>](./cli/start.md) | Start a workspace |
52+
| [<code>stat</code>](./cli/stat.md) | Show workspace resource usage. |
5253
| [<code>state</code>](./cli/state.md) | Manually manage Terraform state to fix broken workspaces |
5354
| [<code>stop</code>](./cli/stop.md) | Stop a workspace |
5455
| [<code>templates</code>](./cli/templates.md) | Manage templates |

docs/cli/stat.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!-- DO NOT EDIT | GENERATED CONTENT -->
2+
3+
# stat
4+
5+
Show workspace resource usage.
6+
7+
## Usage
8+
9+
```console
10+
coder stat [flags]
11+
```
12+
13+
## Options
14+
15+
### -c, --column
16+
17+
| | |
18+
| ------- | -------------------------------------------------------------------------- |
19+
| Type | <code>string-array</code> |
20+
| Default | <code>container_cpu,container_memory,host_cpu,host_memory,home_disk</code> |
21+
22+
Columns to display in table output. Available columns: host cpu, host memory, home disk, container cpu, container memory.
23+
24+
### -o, --output
25+
26+
| | |
27+
| ------- | ------------------- |
28+
| Type | <code>string</code> |
29+
| Default | <code>table</code> |
30+
31+
Output format. Available formats: table, json.

docs/manifest.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,11 @@
703703
"description": "Start a workspace",
704704
"path": "cli/start.md"
705705
},
706+
{
707+
"title": "stat",
708+
"description": "Show workspace resource usage.",
709+
"path": "cli/stat.md"
710+
},
706711
{
707712
"title": "state",
708713
"description": "Manually manage Terraform state to fix broken workspaces",

0 commit comments

Comments
 (0)