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: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OkSuccess is no error.
	OkSuccess = prom.Success
	// OkRegistrationNew indicates something new was registered.
	OkRegistrationNew = "ok_new"
	// OkRegiststrationUpdated indicates a registration was updated.
	OkRegiststrationUpdated = "ok_updated"
	// OkRequestCached indicates the request could be processed and the result
	// came from cache.
	OkRequestCached = "ok_cached"
	// OkRequestFetched indicates the request could be processed but the result
	// needed to be fetched from a remote server.
	OkRequestFetched = "ok_fetched"
	// ErrParse indicates a parse error.
	ErrParse = prom.ErrParse
	// ErrInternal indicates an internal problem (likely a code bug).
	ErrInternal = prom.ErrInternal
	// ErrCrypto indicates a problem with crypto.
	ErrCrypto = prom.ErrCrypto
	// ErrDB indicates a problem with the DB.
	ErrDB = prom.ErrDB
	// ErrTimeout indicates a timeout error.
	ErrTimeout = prom.ErrTimeout
	// ErrNetwork indicates a problem with the network.
	ErrNetwork = prom.ErrNetwork
	// ErrNotClassified indicates an error that is not further classified.
	ErrNotClassified = prom.ErrNotClassified
	// ErrNoPath indicates no path is available to send a message.
	ErrNoPath = "err_nopath"
)

Result values

View Source
const (
	RevSrcNotification = "notification"
	RevSrcSCMP         = "scmp"
	RevSrcPathReply    = "path_reply"
)

Revocation sources

View Source
const (
	LabelSrc    = prom.LabelSrc
	LabelResult = prom.LabelResult
	LabelType   = "type"
)

Label values

View Source
const Namespace = "ps"

Namespace is the metrics namespace for the path server.

Variables

View Source
var (
	// Registrations contains metrics for segments registrations.
	Registrations = newRegistration()
	// Requests contains metrics for segments requests.
	Requests = newRequests()
	// Sync contains metrics for segment synchronization.
	Sync = newSync()
	// Revocation contains metrics for revocations.
	Revocation = newRevocation()
)

Group of metrics.

Functions

func DetermineReplyType

func DetermineReplyType(segs segfetcher.Segments) proto.PathSegType

DetermineReplyType determines which type of segments is in the reply. The method assumes that segs only contains one type of segments.

Types

type Registration

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

Registration contains metrics for segments registrations. The metrics are the following: ps_registrations_total (total number of registrations)

func (Registration) ResultsTotal

ResultsTotal returns the counter for ResultsTotal for the given counter.

type RegistrationLabels

type RegistrationLabels struct {
	Result string
	Type   proto.PathSegType
	Src    addr.IA
}

RegistrationLabels contains the label values for registration metrics.

func (RegistrationLabels) Labels

func (l RegistrationLabels) Labels() []string

Labels returns the labels.

func (RegistrationLabels) Values

func (l RegistrationLabels) Values() []string

Values returns the values.

type Request

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

Request is for request metrics.

func (Request) Count

Count returns the counter for requests total.

func (Request) RepliedRevs

func (r Request) RepliedRevs(l RequestOkLabels) prometheus.Counter

RepliedRevs returns the counter for the number of revocations in a seg reply.

func (Request) RepliedSegs

func (r Request) RepliedSegs(l RequestOkLabels) prometheus.Counter

RepliedSegs returns the counter for the number of segments in a seg reply.

type RequestLabels

type RequestLabels struct {
	Result string
	RequestOkLabels
}

RequestLabels contains the labels for requests.

func (RequestLabels) Labels

func (l RequestLabels) Labels() []string

Labels returns the labels.

func (RequestLabels) Values

func (l RequestLabels) Values() []string

Values returns the values.

func (RequestLabels) WithResult

func (l RequestLabels) WithResult(result string) RequestLabels

WithResult returns the labels with the modified result.

type RequestOkLabels

type RequestOkLabels struct {
	SegType   proto.PathSegType
	CacheOnly bool
	DstISD    addr.ISD
}

RequestOkLabels contains the labels for a request that succeeded.

func (RequestOkLabels) Labels

func (l RequestOkLabels) Labels() []string

Labels returns the labels.

func (RequestOkLabels) Values

func (l RequestOkLabels) Values() []string

Values returns the values.

type RevocationLabels

type RevocationLabels struct {
	Result string
	Src    string
}

RevocationLabels are the labels for revocation metrics.

func (RevocationLabels) Labels

func (l RevocationLabels) Labels() []string

Labels returns the labels.

func (RevocationLabels) Values

func (l RevocationLabels) Values() []string

Values returns the values for the labels.

func (RevocationLabels) WithResult

func (l RevocationLabels) WithResult(result string) RevocationLabels

WithResult returns the labels with the result set.

type SyncPushLabels

type SyncPushLabels struct {
	Result string
	Dst    addr.IA
}

SyncPushLabels contains the label values for synchronization pushes.

func (SyncPushLabels) Labels

func (l SyncPushLabels) Labels() []string

Labels returns the labels.

func (SyncPushLabels) Values

func (l SyncPushLabels) Values() []string

Values returns the values.

func (SyncPushLabels) WithResult

func (l SyncPushLabels) WithResult(result string) SyncPushLabels

WithResult return the labels with a changed result.

type SyncRegLabels

type SyncRegLabels struct {
	Result string
	Src    addr.IA
}

SyncRegLabels contains the label values for synchronization registration metrics.

func (SyncRegLabels) Labels

func (l SyncRegLabels) Labels() []string

Labels returns the labels.

func (SyncRegLabels) Values

func (l SyncRegLabels) Values() []string

Values returns the values.

func (SyncRegLabels) WithResult

func (l SyncRegLabels) WithResult(result string) SyncRegLabels

WithResult return the labels with a changed result.

Jump to

Keyboard shortcuts

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