metrics

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetTRC                 = "get_trc"
	GetRawTRC              = "get_raw_trc"
	GetTRCInfo             = "get_trc_info"
	GetIssuingGrantKeyInfo = "get_issuing_grant_key_info"
	InsertTRC              = "insert_trc"
	TRCExists              = "trc_exists"

	GetRawChain = "get_raw_chain"
	ChainExists = "chain_exists"
	InsertChain = "insert_chain"

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

Database operations.

View Source
const (
	ByAttributes  = "by_attributes"
	HasAttributes = "has_attributes"
)

Inspection types

View Source
const (
	Chain = "chain"
	TRC   = "trc"
	ASKey = "as_key"
)

Trust material

View Source
const (
	TRCReq    = "trc_request"
	TRCPush   = "trc_push"
	ChainReq  = "chain_request"
	ChainPush = "chain_push"
	LatestTRC = "latest_trc_number"
)

Request types

View Source
const (
	SigVerification = "signature_verification"
	ASInspector     = "trc_inspection"
	App             = "application"
)

Triggers

View Source
const (
	Success    = prom.Success
	OkExists   = "ok_exists"
	OkInserted = "ok_inserted"

	ErrMismatch = "err_content_mismatch"
	ErrDB       = prom.ErrDB
	ErrInactive = "err_inactive"
	ErrInternal = prom.ErrInternal
	ErrKey      = "err_key"
	ErrNotFound = "err_not_found"
	ErrParse    = prom.ErrParse
	ErrTransmit = "err_transmit"
	ErrValidate = prom.ErrValidate
	ErrVerify   = prom.ErrVerify
)

Result 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()
	// Inserter exposes the inserter metrics.
	Inserter = newInserter()
	// Inspector exposes the inspector metrics.
	Inspector = newInspector()
	// Provider exposes the provider metrics.
	Provider = newProvider()
	// Resolver exposes the resolver metrics.
	Resolver = newResolver()
	// Signer exposes the signer metrics.
	Signer = newSigner()
	// Verifier exposes the verifier metrics.
	Verifier = newVerifier()
)

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
	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 InserterLabels added in v0.5.0

type InserterLabels struct {
	Type   string
	Result string
}

InserterLabels defines the trust material insert labels.

func (InserterLabels) Labels added in v0.5.0

func (l InserterLabels) Labels() []string

Labels returns the list of labels.

func (InserterLabels) Values added in v0.5.0

func (l InserterLabels) Values() []string

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

func (InserterLabels) WithResult added in v0.5.0

func (l InserterLabels) WithResult(result string) InserterLabels

WithResult returns the lookup labels with the modified result.

type InspectorLabels added in v0.5.0

type InspectorLabels struct {
	Type   string
	Result string
}

InspectorLabels defines the trust material insert labels.

func (InspectorLabels) Labels added in v0.5.0

func (l InspectorLabels) Labels() []string

Labels returns the list of labels.

func (InspectorLabels) Values added in v0.5.0

func (l InspectorLabels) Values() []string

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

func (InspectorLabels) WithResult added in v0.5.0

func (l InspectorLabels) WithResult(result string) InspectorLabels

WithResult returns the lookup labels with the modified result.

type ProviderLabels added in v0.5.0

type ProviderLabels struct {
	Type    string
	Trigger string
	Result  string
}

ProviderLabels defines the trust material provider labels.

func (ProviderLabels) Labels added in v0.5.0

func (l ProviderLabels) Labels() []string

Labels returns the list of labels.

func (ProviderLabels) Values added in v0.5.0

func (l ProviderLabels) Values() []string

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

func (ProviderLabels) WithResult added in v0.5.0

func (l ProviderLabels) WithResult(result string) ProviderLabels

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 ResolverLabels added in v0.5.0

type ResolverLabels struct {
	Type    string
	Trigger string
	Peer    string
	Result  string
}

ResolverLabels defines the trust material resolver labels.

func (ResolverLabels) Labels added in v0.5.0

func (l ResolverLabels) Labels() []string

Labels returns the list of labels.

func (ResolverLabels) Values added in v0.5.0

func (l ResolverLabels) Values() []string

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

func (ResolverLabels) WithResult added in v0.5.0

func (l ResolverLabels) WithResult(result string) ResolverLabels

WithResult returns the lookup labels with the modified result.

type SignerLabels added in v0.5.0

type SignerLabels struct {
	Result string
}

SignerLabels defines the trust material resolver labels.

func (SignerLabels) Labels added in v0.5.0

func (l SignerLabels) Labels() []string

Labels returns the list of labels.

func (SignerLabels) Values added in v0.5.0

func (l SignerLabels) Values() []string

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

func (SignerLabels) WithResult added in v0.5.0

func (l SignerLabels) WithResult(result string) SignerLabels

WithResult returns the lookup labels with the modified result.

type VerifierLabels added in v0.5.0

type VerifierLabels struct {
	Result string
}

VerifierLabels defines the trust material resolver labels.

func (VerifierLabels) Labels added in v0.5.0

func (l VerifierLabels) Labels() []string

Labels returns the list of labels.

func (VerifierLabels) Values added in v0.5.0

func (l VerifierLabels) Values() []string

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

func (VerifierLabels) WithResult added in v0.5.0

func (l VerifierLabels) WithResult(result string) VerifierLabels

WithResult returns the lookup labels with the modified result.

Jump to

Keyboard shortcuts

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