promworker

package
v0.0.0-...-c60b214 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: GPL-3.0, LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(prefix string) *worker.Pool

New creates a worker.Pool backed by prometheus stats. It will create and register: - a {{prefix}}_jobs_count gauge keeping track of the number of jobs currently running - a {{prefix}}_jobs_sum counter keeping track of the total number of jobs ran - a {{prefix}}_trace_nanoseconds summary keeping track of the duration time of traces You have to start the prometheus server yourself, though

Types

type Trace

type Trace struct {
	// contains filtered or unexported fields
}

Trace keeps track of the duration of actions

func (*Trace) Mark

func (t *Trace) Mark(action string)

Mark observes the time elapsed from the previous Mark or the creation of the Trace

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

Tracer keeps track of the duration of jobs launched with pool.RunTraced() with a prometheus summary with the following labels: - scope: used to identify traces - action: used to identify actions inside of traces

func (*Tracer) New

func (t *Tracer) New(scope string) worker.Trace

New creates a new Trace with the given scope

Jump to

Keyboard shortcuts

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