metrics

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DstBR indicates the destination to be Border Router.
	DstBR = "br"
	// DstPS indicates the destination to be Path Server.
	DstPS = "ps"

	// ErrDB indicates an error during validation.
	ErrDB = prom.ErrDB
	// ErrCreate indicates an error during creation.
	ErrCreate = "err_create"
	// ErrParse indicates an error during processing.
	ErrParse = prom.ErrParse
	// ErrProcess indicates an error during processing.
	ErrProcess = prom.ErrProcess
	// ErrPrefilter indicates an error during pre-filtering.
	ErrPrefilter = "err_prefilter"
	// ErrVerify indicates an error during verification.
	ErrVerify = prom.ErrVerify
	// ErrSend indicates an error during verification.
	ErrSend = "err_send"

	// OkFiltered indicates beacon was filtered by policy.
	OkFiltered = "ok_filtered"
	// OkNew indicates beacon was inserted for the first time.
	OkNew = "ok_new"
	// OkOld indicates that a beacon with older timestamp was received
	// and therefore it was not inserted or updated in db.
	OkOld = "ok_old"
	// OkUpdated indicates existing beacon in db was updated.
	OkUpdated = "ok_updated"

	// RevNew indicates a new issued revocation.
	RevNew = "new"
	// RevRenew indicates a renew of an already issued revocation.
	RevRenew = "renew"
	// RevFromCtrl indicates that revocation was sent control payload.
	RevFromCtrl = "ctrl"

	// Success indicates a successful result.
	Success = prom.Success
)

Labels values.

View Source
const Namespace = "bs"

Namespace is the metrics namespace for the beacon server.

Variables

View Source
var (
	// Beaconing is the single-instance struct to get prometheus metrics or counters.
	Beaconing = newBeaconing()
	// Ifstate is the single-instance struct to get prometheus metrics or counters.
	Ifstate = newIfstate()
	// Keepalive is the single-instance struct to get keepalive prometheus counters.
	Keepalive = newKeepalive()
	// Originator is the single-instance struct to get prometheus counters.
	Originator = newOriginator()
	// Propagator is the single-instance struct to get prometheus metrics or counters.
	Propagator = newPropagator()
	// Revocation is the single-instance struct to get prometheus counters.
	Revocation = newRevocation()
	// Registrar is the single-instance struct to get prometheus metrics or counters.
	Registrar = newRegistrar()
)

Functions

func GetResultValue

func GetResultValue(ins, upd, flt int) string

GetResultValue return result label value given insert stats.

Types

type BeaconingLabels

type BeaconingLabels struct {
	InIfID  common.IFIDType
	NeighIA addr.IA
	Result  string
}

BeaconingLabels is used by clients to pass in a safe way labels values to prometheus metric types (e.g. counter).

func (BeaconingLabels) Labels

func (l BeaconingLabels) Labels() []string

Labels returns the name of the labels in correct order.

func (BeaconingLabels) Values

func (l BeaconingLabels) Values() []string

Values returns the values of the label in correct order.

func (BeaconingLabels) WithResult

func (l BeaconingLabels) WithResult(result string) BeaconingLabels

WithResult returns the label set with the modfied result.

type DurationLabels

type DurationLabels struct {
	IfID    common.IFIDType
	NeighIA addr.IA
}

DurationLabels define the labels attached to duration metric.

func (DurationLabels) Labels

func (l DurationLabels) Labels() []string

Labels returns the list of labels.

func (DurationLabels) Values

func (l DurationLabels) Values() []string

Values returns the label values in the order defined by Labels.

type IfstateLabels

type IfstateLabels struct {
	IfID    common.IFIDType
	NeighIA addr.IA
}

IfstateLabels define the labels attached to interface state.

func (IfstateLabels) Labels

func (l IfstateLabels) Labels() []string

Labels returns the list of labels.

func (IfstateLabels) Values

func (l IfstateLabels) Values() []string

Values returns the label values in the order defined by Labels.

type IssuedLabels

type IssuedLabels struct {
	IfID    common.IFIDType
	NeighIA addr.IA
	State   string
}

IssuedLabels define the labels attached to revocation metrics.

func (IssuedLabels) Labels

func (l IssuedLabels) Labels() []string

Labels returns the list of labels.

func (IssuedLabels) Values

func (l IssuedLabels) Values() []string

Values returns the label values in the order defined by Labels.

type KeepaliveLabels

type KeepaliveLabels struct {
	IfID   common.IFIDType
	Result string
}

KeepaliveLabels is used by clients to pass in a safe way labels values to prometheus metric types (e.g. counter).

func (KeepaliveLabels) Labels

func (l KeepaliveLabels) Labels() []string

Labels returns the name of the labels in correct order.

func (KeepaliveLabels) Values

func (l KeepaliveLabels) Values() []string

Values returns the values of the label in correct order.

type OriginatorLabels

type OriginatorLabels struct {
	EgIfID common.IFIDType
	Result string
}

OriginatorLabels define the labels attached to originator metrics.

func (OriginatorLabels) Labels

func (l OriginatorLabels) Labels() []string

Labels returns the name of the labels in correct order.

func (OriginatorLabels) Values

func (l OriginatorLabels) Values() []string

Values returns the values of the label in correct order.

func (OriginatorLabels) WithResult

func (l OriginatorLabels) WithResult(result string) OriginatorLabels

WithResult returns the label set with the modfied result.

type PropagatorLabels

type PropagatorLabels struct {
	InIfID, EgIfID common.IFIDType
	StartIA        addr.IA
	Result         string
}

PropagatorLabels define the labels attached to propagator metrics.

func (PropagatorLabels) Labels

func (l PropagatorLabels) Labels() []string

Labels returns the name of the labels in correct order.

func (PropagatorLabels) Values

func (l PropagatorLabels) Values() []string

Values returns the values of the label in correct order.

type RegistrarLabels

type RegistrarLabels struct {
	InIfID          common.IFIDType
	StartIA         addr.IA
	Result, SegType string
}

RegistrarLabels define the labels attached to registrar metrics.

func (RegistrarLabels) Labels

func (l RegistrarLabels) Labels() []string

Labels returns the name of the labels in correct order.

func (RegistrarLabels) Values

func (l RegistrarLabels) Values() []string

Values returns the values of the label in correct order.

type RevocationLabels

type RevocationLabels struct {
	Result, Method string
}

RevocationLabels define the labels attached to revocation metrics.

func (RevocationLabels) Labels

func (l RevocationLabels) Labels() []string

Labels returns the list of labels.

func (RevocationLabels) Values

func (l RevocationLabels) Values() []string

Values returns the label values in the order defined by Labels.

type SentLabels

type SentLabels struct {
	Dst string
}

SentLabels define the labels attached to sent revocation counter.

func (SentLabels) Labels

func (l SentLabels) Labels() []string

Labels returns the list of labels.

func (SentLabels) Values

func (l SentLabels) Values() []string

Values returns the label values in the order defined by Labels.

type TypeOnlyLabel

type TypeOnlyLabel struct {
	SegType string
}

TypeOnlyLabel is used by clients to pass in a safe way labels values to prometheus metric types (e.g. counter).

func (TypeOnlyLabel) Labels

func (l TypeOnlyLabel) Labels() []string

Labels returns the name of the labels in correct order.

func (TypeOnlyLabel) Values

func (l TypeOnlyLabel) Values() []string

Values returns the values of the label in correct order.

Jump to

Keyboard shortcuts

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