Documentation ¶
Index ¶
Constants ¶
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
const ( RevSrcNotification = "notification" RevSrcSCMP = "scmp" RevSrcPathReply = "path_reply" )
Revocation sources
const ( LabelSrc = prom.LabelSrc LabelResult = prom.LabelResult LabelType = "type" )
Label values
const Namespace = "ps"
Namespace is the metrics namespace for the path server.
Variables ¶
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 ¶
func (r Registration) ResultsTotal(l RegistrationLabels) prometheus.Counter
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 ¶
func (r Request) Count(l RequestLabels) prometheus.Counter
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) 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 ¶
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 ¶
SyncPushLabels contains the label values for synchronization pushes.
func (SyncPushLabels) WithResult ¶
func (l SyncPushLabels) WithResult(result string) SyncPushLabels
WithResult return the labels with a changed result.
type SyncRegLabels ¶
SyncRegLabels contains the label values for synchronization registration metrics.
func (SyncRegLabels) WithResult ¶
func (l SyncRegLabels) WithResult(result string) SyncRegLabels
WithResult return the labels with a changed result.