• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.ci/scripts/H29-Oct-2019-

internal/registry/H29-Oct-2019-

providers/H29-Oct-2019-

testing/H03-May-2022-

types/H29-Oct-2019-

.appveyor.ymlH A D29-Oct-20191.8 KiB

.editorconfigH A D29-Oct-2019362

.gitattributesH A D29-Oct-2019212

.gitignoreH A D29-Oct-201988

.travis.ymlH A D29-Oct-2019364

CHANGELOG.mdH A D29-Oct-20192.4 KiB

MakefileH A D29-Oct-2019682

README.mdH A D29-Oct-20191.9 KiB

go.modH A D29-Oct-2019400

go.sumH A D29-Oct-20192.5 KiB

system.goH A D29-Oct-20192.8 KiB

system_test.goH A D29-Oct-20197 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