metrics

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2018 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetricsSubmissionTimeout is the timeout for a metrics submission request
	MetricsSubmissionTimeout = 45 * time.Second
)

Variables

This section is empty.

Functions

func Disable

func Disable(conf *config.Config) error

Disable metrics

func Enable

func Enable(conf *config.Config) error

Enable metrics

func Purge

func Purge() (err error)

Purge current metrics file

func Rec

func Rec(conf *config.Config, e Event)

Rec event if analytics is enabled

func RecOrFail

func RecOrFail(conf *config.Config, e Event) (saved bool, err error)

RecOrFail records event if analytics is enabled and returns an error on failure

func Reset

func Reset(conf *config.Config) error

Reset metrics by regenerating metrics ID and purge existing metrics

func SetPID

func SetPID(p int) (uniquePID string)

SetPID enhances real PID with prefix to distinguish between repeating PIDs

func SetPath

func SetPath(path string)

SetPath sets the path for the metric file

func SubmitEventuallyOnBackground

func SubmitEventuallyOnBackground(conf *config.Config) (err error)

SubmitEventuallyOnBackground eventually forks a child process that submits analytics to WeDeploy if the analytics reporting is enabled

Types

type Event

type Event struct {
	Type  string
	Text  string
	Tags  []string
	Extra map[string]string
}

Event entry see also collector.Event

type Sender

type Sender struct {
	Purge bool
	// contains filtered or unexported fields
}

Sender for the metrics

func (*Sender) TrySubmit

func (s *Sender) TrySubmit(conf *config.Config) (int, error)

TrySubmit events file if enabled

Jump to

Keyboard shortcuts

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