Skip to content

Commit

Permalink
begin work of supporting current resource usage
Browse files Browse the repository at this point in the history
This patch begins the process of supporting current resource usage
information in `ghw`. The first resource we support is memory on Linux
systems.

Users can use the `ghw.WithCollectUsage(true)` function to instruct
`ghw` to gather usage information for the module in question.
Alternately, users can use the `GHW_COLLECT_USAGE=1` environs variable.
The following shows the effect of the variable:

```
jaypipes@lappie:~/src/github.com/jaypipes/ghw$ go run cmd/ghwc/main.go memory
memory (16GB physical, 16GB usable)
jaypipes@lappie:~/src/github.com/jaypipes/ghw$ GHW_COLLECT_USAGE=1 go run cmd/ghwc/main.go memory
memory (16GB physical, 16GB usable, 9GB used)
```

Issue #357

Signed-off-by: Jay Pipes <[email protected]>
  • Loading branch information
jaypipes committed Dec 30, 2023
1 parent 835f6a2 commit 990b2cb
Show file tree
Hide file tree
Showing 5 changed files with 305 additions and 153 deletions.
Loading

0 comments on commit 990b2cb

Please sign in to comment.