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 (
	GetIssCert     = "get_iss_cert"
	GetIssCertMax  = "get_iss_cert_max"
	GetAllIssCerts = "get_all_iss_certs"
	GetChain       = "get_chain"
	GetChainMax    = "get_chain_max"
	GetAllChains   = "get_all_chains"
	GetTRC         = "get_trc"
	GetTRCMax      = "get_trc_max"
	GetAllTRCs     = "get_all_trcs"
	GetCustKey     = "get_cust_key"
	GetAllCustKeys = "get_all_cust_keys"

	InsertIssCert = "insert_iss_cert"
	InsertChain   = "insert_chain"
	InsertTRC     = "insert_trc"
	InsertCustKey = "insert_cust_key"

	BeginTx    = "tx_begin"
	CommitTx   = "tx_commit"
	RollbackTx = "tx_rollback"
)

Database operations.

View Source
const (
	TRCReq          = "trc_req"
	TRCPush         = "trc_push"
	ChainReq        = "chain_req"
	ChainPush       = "chain_push"
	SigVerification = "sig_verification"
	ASInspector     = "as_inspector"
	Load            = "load"
	App             = "application"
)

Request type strings.

View Source
const (
	Success     = prom.Success
	OkCached    = "ok_cached"
	OkRequested = "ok_requested"
	OkExists    = "ok_exists"
	OkInserted  = "ok_inserted"

	ErrDB           = prom.ErrDB
	ErrDenied       = "err_denied"
	ErrInternal     = prom.ErrInternal
	ErrTransmit     = "err_transmit"
	ErrTimeout      = prom.ErrTimeout
	ErrValidate     = prom.ErrValidate
	ErrVerify       = prom.ErrVerify
	ErrTRC          = "err_trc"
	ErrNotFound     = "err_not_found"
	ErrNotFoundAuth = "err_not_found_auth"
)

Result type strings.

View Source
const (
	Chain     = "chain"
	Signature = "signature"
)

Verification types.

View Source
const Namespace = "truststore"

Namespace is the prometheus namespace.

Variables

View Source
var (
	// DB exposes the database metrics.
	DB = newDB()
	// Handler exposes the handler metrics.
	Handler = newHandler()
	// Store exposes the store metrics.
	Store = newStore()
)

Functions

func CtxWith

func CtxWith(ctx context.Context, trigger string) context.Context

CtxWith returns a new context, based on ctx, that embeds argument trigger.

func FromCtx

func FromCtx(ctx context.Context) string

FromCtx returns the trigger embedded in ctx if one exists, or the empty string otherwise.

Types

type HandlerLabels

type HandlerLabels struct {
	Client    string
	ReqType   string
	CacheOnly bool
	Result    string
}

HandlerLabels defines the handler labels.

func (HandlerLabels) Labels

func (l HandlerLabels) Labels() []string

Labels returns the list of labels.

func (HandlerLabels) Values

func (l HandlerLabels) Values() []string

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

func (HandlerLabels) WithResult

func (l HandlerLabels) WithResult(result string) HandlerLabels

WithResult returns the handler labels with the modified result.

type LookupLabels

type LookupLabels struct {
	Client    string
	Trigger   string
	ReqType   string
	CacheOnly bool
	Result    string
}

LookupLabels defines the trust material lookup labels.

func (LookupLabels) Labels

func (l LookupLabels) Labels() []string

Labels returns the list of labels.

func (LookupLabels) Values

func (l LookupLabels) Values() []string

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

func (LookupLabels) WithResult

func (l LookupLabels) WithResult(result string) LookupLabels

WithResult returns the lookup labels with the modified result.

type QueryLabels

type QueryLabels struct {
	Driver    string
	Operation string
	Result    string
}

QueryLabels defines the database query labels.

func (QueryLabels) Labels

func (l QueryLabels) Labels() []string

Labels returns the list of labels.

func (QueryLabels) Values

func (l QueryLabels) Values() []string

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

type SentLabels

type SentLabels struct {
	Client    string
	Server    string
	Trigger   string
	ReqType   string
	CacheOnly bool
	Result    string
}

SentLabels defines the outgoing request labels.

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.

func (SentLabels) WithResult

func (l SentLabels) WithResult(result string) SentLabels

WithResult returns the outgoing labels with the modified result.

type VerificationLabels

type VerificationLabels struct {
	Type   string
	Result string
}

VerificationLabels defines the outgoing request labels.

func (VerificationLabels) Labels

func (l VerificationLabels) Labels() []string

Labels returns the list of labels.

func (VerificationLabels) Values

func (l VerificationLabels) Values() []string

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

func (VerificationLabels) WithResult

func (l VerificationLabels) WithResult(result string) VerificationLabels

WithResult returns the verification labels with the modified result.

Jump to

Keyboard shortcuts

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