icarus

package
v0.0.0-...-08aab93 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetricToProm

func MetricToProm(met util.Metric) string

MetricToProm changes a map into a string.

Types

type Icarus

type Icarus struct {
	*sync.Mutex
	Store  *IcarusStore
	Ticker *time.Ticker
	Chan   chan util.Metric
	// contains filtered or unexported fields
}

Icarus is like a prometheus store except it's easy to hurt yourself with.

func NewIcarus

func NewIcarus(prefix string) *Icarus

NewIcarus builds and starts an icarus process.

func (*Icarus) Finish

func (u *Icarus) Finish()

Finish does nothing

func (*Icarus) HandleFunc

func (i *Icarus) HandleFunc(w http.ResponseWriter, r *http.Request)

HandleFunc is an http handlefunc function. Apes a prometheus endpoint.

func (*Icarus) Record

func (i *Icarus) Record(x util.Metric)

Record puts things into the icarus channel.

type IcarusStore

type IcarusStore struct {
	*sync.Mutex
	Keep    int
	Index   int
	Metrics []map[string]util.Metric
}

IcarusStore holds sets of metrics and retires them as necessary.

func NewRollingStore

func NewRollingStore(lookback int) *IcarusStore

Get back a new implementation of the rolling store

func (*IcarusStore) Dump

func (r *IcarusStore) Dump() []util.Metric

Dump all the []Metrics in the rolling store.

func (*IcarusStore) Insert

func (r *IcarusStore) Insert(met util.Metric)

Insert something into the current store in the rolling store

func (*IcarusStore) Roll

func (r *IcarusStore) Roll()

Roll the rolling store

type ServePage

type ServePage struct {
	*sync.RWMutex
	Page string
	Link *ServePage
}

ServePage holds a linked list of pages to serve over http.

func NewServePage

func NewServePage() *ServePage

NewServePage generates a linked list of pages to serve.

func (*ServePage) AddPage

func (s *ServePage) AddPage()

AddPage adds another page to serve.

func (*ServePage) Next

func (s *ServePage) Next() *ServePage

Next advances the servepage list.

func (*ServePage) Read

func (s *ServePage) Read() string

func (*ServePage) Write

func (s *ServePage) Write(inp string)

Jump to

Keyboard shortcuts

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