toputils

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2016 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

View Source
const DisplaySubscriptions = 1

Variables

This section is empty.

Functions

func Psize

func Psize(s int64) string

Psize takes a float and returns a human readable string.

Types

type Engine added in v0.1.1

type Engine struct {
	Host        string
	Port        int
	HttpClient  *http.Client
	Uri         string
	Conns       int
	SortOpt     gnatsd.SortOpt
	Delay       int
	DisplaySubs bool
	StatsCh     chan *Stats
	ShutdownCh  chan struct{}
}

func NewEngine added in v0.1.1

func NewEngine(host string, port int, conns int, delay int) *Engine

func (*Engine) MonitorStats added in v0.1.1

func (engine *Engine) MonitorStats() error

MonitorStats is ran as a goroutine and takes options which can modify how poll values then sends to channel.

func (*Engine) Request added in v0.1.1

func (engine *Engine) Request(path string) (interface{}, error)

Request takes a path and options, and returns a Stats struct with with either connz or varz

func (*Engine) SetupHTTP added in v0.1.1

func (engine *Engine) SetupHTTP()

SetupHTTP sets up the http client and uri to use for polling.

func (*Engine) SetupHTTPS added in v0.1.1

func (engine *Engine) SetupHTTPS(caCertOpt, certOpt, keyOpt string, skipVerifyOpt bool) error

SetupHTTPS sets up the http client and uri to use for polling.

type Rates

type Rates struct {
	InMsgsRate   float64
	OutMsgsRate  float64
	InBytesRate  float64
	OutBytesRate float64
}

Rates represents the tracked in/out msgs and bytes flow from a NATS server.

type Stats

type Stats struct {
	Varz  *gnatsd.Varz
	Connz *gnatsd.Connz
	Rates *Rates
}

Stats represents the monitored data from a NATS server.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL