Access Solaris kstats from Go. Provides a Go API for the Solaris kstat library for retrieving kernel statistics.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Chris Siebenmann 4e8294f9e9 Update README to the current state of things and add LICENSE 5 months ago
cmd Add support for kstat_chain_update() 4 years ago
gen Add support for IO kstats 5 years ago
.gitignore Initial commit of apparently working code. 5 years ago
LICENSE Update README to the current state of things and add LICENSE 5 months ago
Makefile Added a Makefile to somewhat automate kstat-godoc.txt creation 4 years ago
README Update README to the current state of things and add LICENSE 5 months ago
doc.go doc.go: be clearer about the kstat source code stuff 4 years ago
kstat-godoc.txt doc.go: be clearer about the kstat source code stuff 4 years ago
kstat_solaris.go Add support for kstat_chain_update() 4 years ago
kstat_solaris_test.go Add support for kstat_chain_update() 4 years ago
raw_solaris.go Add support for raw kstat statistics 5 years ago
raw_solaris_test.go Add support for raw kstat statistics 5 years ago
types_solaris_amd64.go Mntinfo: rename Proto and Curserver fields, provide access methods 5 years ago
types_solaris_amd64_test.go Mntinfo: rename Proto and Curserver fields, provide access methods 5 years ago

README

Go-kstat provides a Go API for the kstat kernel statistics system
on Solaris, Illumos, OmniOS, and other Solaris derived systems. For
general information on kstats, see the kstat(1) and kstat(3kstat)
manpages. For more documentation on the details of the package, see
doc.go, kstat_solaris.go, types_solaris_amd64.go, and raw_solaris.go.

The API supports access to 'named' kstat statistics, IO statistics,
and the most common and useful sorts of 'raw' kstat statistics
(unix:0:sysinfo, unix:0:vminfo, unix:0:var, and mnt:*:mntinfo).
Other raw kstat statistics are not explicitly supported, but the
API provides some escape hatches for access to custom raw
statistics.

This is a cgo-based package so it can't be cross compiled like a regular
Go package. It may also have bugs with memory management, since it
interacts with the Solaris kstat library and holds references to memory
that's been dynamically allocated in C.

See kstat-godoc.txt for a text dump of the full godoc for the package.
Unfortunately Go tool limitations appear to make it impossible to
see full package documentation on anything except a Solaris machine
(including https://godoc.org/, sadly).

Bug reports and other contributions are highly welcome.

IMPORTANT NOTE (March 2020): We no longer use any Solaris or Illumos
based systems. This package worked fine for us while we had such systems
and I never found any bugs, but without Illumos systems I'm no longer
in a position to further update the package in any meaningful way. I
would be happy to pass this package to someone is still using Solaris
or Illumos based systems and so can actively develop it, if any further
development is necessary. I am happy to accept pull requests from people
with Illumos systems who can do the necessary testing and so on.

Given this, I don't currently expect to release an official version 1.0
of the package or update it to be a Go module. I would again be happy to
accept pull requests.

Author:

Chris Siebenmann
https://github.com/siebenmann/go-kstat
https://utcc.utoronto.ca/~cks/space/blog/

(and elsewhere)

Copyright: BSD-3-Clause, see LICENSE
(This is the copyright used by Go and projects copying its license.)