Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
.ci/scripts/ | H | 29-Oct-2019 | - | |||
internal/registry/ | H | 29-Oct-2019 | - | |||
providers/ | H | 29-Oct-2019 | - | |||
testing/ | H | 03-May-2022 | - | |||
types/ | H | 29-Oct-2019 | - | |||
.appveyor.yml | H A D | 29-Oct-2019 | 1.8 KiB | |||
.editorconfig | H A D | 29-Oct-2019 | 362 | |||
.gitattributes | H A D | 29-Oct-2019 | 212 | |||
.gitignore | H A D | 29-Oct-2019 | 88 | |||
.travis.yml | H A D | 29-Oct-2019 | 364 | |||
CHANGELOG.md | H A D | 29-Oct-2019 | 2.4 KiB | |||
Makefile | H A D | 29-Oct-2019 | 682 | |||
README.md | H A D | 29-Oct-2019 | 1.9 KiB | |||
go.mod | H A D | 29-Oct-2019 | 400 | |||
go.sum | H A D | 29-Oct-2019 | 2.5 KiB | |||
system.go | H A D | 29-Oct-2019 | 2.8 KiB | |||
system_test.go | H A D | 29-Oct-2019 | 7 KiB |
README.md
1# go-sysinfo 2 3[![Build Status](http://img.shields.io/travis/elastic/go-sysinfo.svg?style=flat-square)][travis] 4[![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs] 5 6[travis]: http://travis-ci.org/elastic/go-sysinfo 7[godocs]: http://godoc.org/github.com/elastic/go-sysinfo 8 9go-sysinfo is a library for collecting system information. This includes 10information about the host machine and processes running on the host. 11 12The available features vary based on what has been implemented by the "provider" 13for the operating system. At runtime you check to see if additional interfaces 14are implemented by the returned `Host` or `Process`. For example: 15 16```go 17process, err := sysinfo.Self() 18if err != nil { 19 return err 20} 21 22if handleCounter, ok := process.(types.OpenHandleCounter); ok { 23 count, err := handleCounter.OpenHandleCount() 24 if err != nil { 25 return err 26 } 27 log.Printf("%d open handles", count) 28} 29``` 30 31These tables show what methods are implemented as well as the extra interfaces 32that are implemented. 33 34| `Host` Features | Darwin | Linux | Windows | 35|------------------|--------|-------|---------| 36| `Info()` | x | x | x | 37| `Memory()` | x | x | x | 38| `CPUTimer` | x | x | x | 39| `VMStat` | | x | | 40 41| `Process` Features | Darwin | Linux | Windows | 42|------------------------|--------|-------|---------| 43| `Info()` | x | x | x | 44| `Memory()` | x | x | x | 45| `User()` | x | x | x | 46| `Parent()` | x | x | x | 47| `CPUTimer` | x | x | x | 48| `Environment` | x | x | | 49| `OpenHandleEnumerator` | | x | | 50| `OpenHandleCounter` | | x | | 51| `Seccomp` | | x | | 52| `Capabilities` | | x | | 53 54 55