metrics

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct{}

Handler implements a Prometheus /metrics endpoint.

func NewHandler

func NewHandler() *Handler

NewHandler returns a new /metrics endpoint which returns Prometheus formatted statistics.

func (*Handler) Handler

func (h *Handler) Handler() common.HTTPRequestHandler

Handler returns the Handler that should be invoked when an HTTP GET is requested to the target endpoint. This Handler must be registered with an HTTP server.

func (*Handler) Method

func (h *Handler) Method() string

Method returns the HTTP method, which is always GET.

func (*Handler) Path

func (h *Handler) Path() string

Path returns the base path of the target URL for this Handler.

type Metrics

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

Metrics manages the metrics for Orb.

func Get

func Get() *Metrics

Get returns an Orb metrics provider.

func (*Metrics) AddOperationTime

func (m *Metrics) AddOperationTime(value time.Duration)

AddOperationTime records the time it takes to add an operation to the queue.

func (*Metrics) AddProofParseCredential

func (m *Metrics) AddProofParseCredential(value time.Duration)

AddProofParseCredential records vct parse credential in add proof.

func (*Metrics) AddProofSign

func (m *Metrics) AddProofSign(value time.Duration)

AddProofSign records vct sign in add proof.

func (*Metrics) BatchAckTime

func (m *Metrics) BatchAckTime(value time.Duration)

BatchAckTime records the time to acknowledge all of the operations that are removed from the queue.

func (*Metrics) BatchCutTime

func (m *Metrics) BatchCutTime(value time.Duration)

BatchCutTime records the time it takes to cut an operation batch. The duration is from the time that the first operation was added to the time that the batch is cut.

func (*Metrics) BatchNackTime

func (m *Metrics) BatchNackTime(value time.Duration)

BatchNackTime records the time to nack all of the operations that are to be placed back on the queue.

func (*Metrics) BatchRollbackTime

func (m *Metrics) BatchRollbackTime(value time.Duration)

BatchRollbackTime records the time it takes to roll back an operation batch (in case of a transient error). The duration is from the time that the first operation was added to the time that the batch is cut.

func (*Metrics) BatchSize

func (m *Metrics) BatchSize(value float64)

BatchSize records the size of an operation batch.

func (*Metrics) CASIncrementCacheHitCount

func (m *Metrics) CASIncrementCacheHitCount()

CASIncrementCacheHitCount increments the number of CAS cache hits.

func (*Metrics) CASReadTime

func (m *Metrics) CASReadTime(casType string, value time.Duration)

CASReadTime records the time it takes to read a document from CAS storage.

func (*Metrics) CASResolveTime

func (m *Metrics) CASResolveTime(value time.Duration)

CASResolveTime records the time it takes to resolve a document from CAS.

func (*Metrics) CASWriteTime

func (m *Metrics) CASWriteTime(value time.Duration)

CASWriteTime records the time it takes to write a document to CAS.

func (*Metrics) DBDeleteTime

func (m *Metrics) DBDeleteTime(dbType string, value time.Duration)

DBDeleteTime records the time it takes to delete in db.

func (*Metrics) DBGetBulkTime

func (m *Metrics) DBGetBulkTime(dbType string, value time.Duration)

DBGetBulkTime records the time it takes to get bulk in db.

func (*Metrics) DBGetTagsTime

func (m *Metrics) DBGetTagsTime(dbType string, value time.Duration)

DBGetTagsTime records the time it takes to get tags in db.

func (*Metrics) DBGetTime

func (m *Metrics) DBGetTime(dbType string, value time.Duration)

DBGetTime records the time it takes to get data in db.

func (*Metrics) DBPutTime

func (m *Metrics) DBPutTime(dbType string, value time.Duration)

DBPutTime records the time it takes to store data in db.

func (*Metrics) DBQueryTime

func (m *Metrics) DBQueryTime(dbType string, value time.Duration)

DBQueryTime records the time it takes to query in db.

func (*Metrics) DocumentCreateUpdateTime

func (m *Metrics) DocumentCreateUpdateTime(value time.Duration)

DocumentCreateUpdateTime records the time it takes the REST handler to process a create/update operation.

func (*Metrics) DocumentResolveTime

func (m *Metrics) DocumentResolveTime(value time.Duration)

DocumentResolveTime records the time it takes the REST handler to resolve a document.

func (*Metrics) InboxHandlerTime

func (m *Metrics) InboxHandlerTime(activityType string, value time.Duration)

InboxHandlerTime records the time it takes to handle an activity posted to the inbox.

func (*Metrics) OutboxIncrementActivityCount

func (m *Metrics) OutboxIncrementActivityCount(activityType string)

OutboxIncrementActivityCount increments the number of activities of the given type posted to the outbox.

func (*Metrics) OutboxPostTime

func (m *Metrics) OutboxPostTime(value time.Duration)

OutboxPostTime records the time it takes to post a message to the outbox.

func (*Metrics) OutboxResolveInboxesTime

func (m *Metrics) OutboxResolveInboxesTime(value time.Duration)

OutboxResolveInboxesTime records the time it takes to resolve inboxes for an outbox post.

func (*Metrics) ProcessAnchorTime

func (m *Metrics) ProcessAnchorTime(value time.Duration)

ProcessAnchorTime records the time it takes for the Observer to process an anchor credential.

func (*Metrics) ProcessDIDTime

func (m *Metrics) ProcessDIDTime(value time.Duration)

ProcessDIDTime records the time it takes for the Observer to process a DID.

func (*Metrics) ProcessWitnessedAnchorCredentialTime

func (m *Metrics) ProcessWitnessedAnchorCredentialTime(value time.Duration)

ProcessWitnessedAnchorCredentialTime records the time it takes to process a witnessed anchor credential by publishing it to the Observer and posting a 'Create' activity.

func (*Metrics) SignerAddLinkedDataProof

func (m *Metrics) SignerAddLinkedDataProof(value time.Duration)

SignerAddLinkedDataProof records add data linked proof.

func (*Metrics) SignerGetKey

func (m *Metrics) SignerGetKey(value time.Duration)

SignerGetKey records get key time.

func (*Metrics) SignerSign

func (m *Metrics) SignerSign(value time.Duration)

SignerSign records sign.

func (*Metrics) WitnessAddProof

func (m *Metrics) WitnessAddProof(value time.Duration)

WitnessAddProof records vct witness add proof.

func (*Metrics) WitnessAddProofVctNil

func (m *Metrics) WitnessAddProofVctNil(value time.Duration)

WitnessAddProofVctNil records vct witness.

func (*Metrics) WitnessAddVC

func (m *Metrics) WitnessAddVC(value time.Duration)

WitnessAddVC records vct witness add vc.

func (*Metrics) WitnessAnchorCredentialTime

func (m *Metrics) WitnessAnchorCredentialTime(value time.Duration)

WitnessAnchorCredentialTime records the time it takes for a verifiable credential to gather proofs from all required witnesses (according to witness policy). The start time is when the verifiable credential is issued and the end time is the time that the witness policy is satisfied.

func (*Metrics) WitnessVerifyVCTSignature

func (m *Metrics) WitnessVerifyVCTSignature(value time.Duration)

WitnessVerifyVCTSignature records vct witness verify vct.

func (*Metrics) WitnessWebFinger

func (m *Metrics) WitnessWebFinger(value time.Duration)

WitnessWebFinger records vct witness web finger.

func (*Metrics) WriteAnchorBuildCredentialTime

func (m *Metrics) WriteAnchorBuildCredentialTime(value time.Duration)

WriteAnchorBuildCredentialTime records the time it takes to build credential inside write anchor.

func (*Metrics) WriteAnchorGetPreviousAnchorsGetBulkTime

func (m *Metrics) WriteAnchorGetPreviousAnchorsGetBulkTime(value time.Duration)

WriteAnchorGetPreviousAnchorsGetBulkTime records the time it takes to get bulk inside previous anchor.

func (*Metrics) WriteAnchorGetPreviousAnchorsTime

func (m *Metrics) WriteAnchorGetPreviousAnchorsTime(value time.Duration)

WriteAnchorGetPreviousAnchorsTime records the time it takes to get previous anchor.

func (*Metrics) WriteAnchorGetWitnessesTime

func (m *Metrics) WriteAnchorGetWitnessesTime(value time.Duration)

WriteAnchorGetWitnessesTime records the time it takes to get witnesses inside write anchor.

func (*Metrics) WriteAnchorPostOfferActivityTime

func (m *Metrics) WriteAnchorPostOfferActivityTime(value time.Duration)

WriteAnchorPostOfferActivityTime records the time it takes to post offer activity inside write anchor.

func (*Metrics) WriteAnchorResolveHostMetaLinkTime

func (m *Metrics) WriteAnchorResolveHostMetaLinkTime(value time.Duration)

WriteAnchorResolveHostMetaLinkTime records the time it takes to resolve host meta link.

func (*Metrics) WriteAnchorSignCredentialTime

func (m *Metrics) WriteAnchorSignCredentialTime(value time.Duration)

WriteAnchorSignCredentialTime records the time it takes to sign credential inside write anchor.

func (*Metrics) WriteAnchorSignLocalStoreTime

func (m *Metrics) WriteAnchorSignLocalStoreTime(value time.Duration)

WriteAnchorSignLocalStoreTime records the time it takes to store inside sign local.

func (*Metrics) WriteAnchorSignLocalWatchTime

func (m *Metrics) WriteAnchorSignLocalWatchTime(value time.Duration)

WriteAnchorSignLocalWatchTime records the time it takes to watch inside sign local.

func (*Metrics) WriteAnchorSignLocalWitnessLogTime

func (m *Metrics) WriteAnchorSignLocalWitnessLogTime(value time.Duration)

WriteAnchorSignLocalWitnessLogTime records the time it takes to witness log inside sign local.

func (*Metrics) WriteAnchorSignWithLocalWitnessTime

func (m *Metrics) WriteAnchorSignWithLocalWitnessTime(value time.Duration)

WriteAnchorSignWithLocalWitnessTime records the time it takes to sign with local witness.

func (*Metrics) WriteAnchorSignWithServerKeyTime

func (m *Metrics) WriteAnchorSignWithServerKeyTime(value time.Duration)

WriteAnchorSignWithServerKeyTime records the time it takes to sign with server key.

func (*Metrics) WriteAnchorTime

func (m *Metrics) WriteAnchorTime(value time.Duration)

WriteAnchorTime records the time it takes to write an anchor credential and post an 'Offer' activity.

Jump to

Keyboard shortcuts

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