monitoring

package
v5.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetBlobStoreStats

func SetBlobStoreStats(s BlobStats)

Types

type BlobStats

type BlobStats struct {
	// Count holds the total number of blobs stored.
	Count int
	// MaxSize holds the size of the largest blob.
	MaxSize int64
	// MeanSize holds the average blob size.
	MeanSize int64
}

BlobStats holds statistics about blobs in the blob store.

type Duration

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

Duration represents a time duration to be montored. The duration starts when the Duration is created and finishes when Done is called.

func NewBlobstoreGCDuration

func NewBlobstoreGCDuration() *Duration

NewBlobstoreGCDuration returns a new Duration to be used for measuring the time taken to run the blobstore garbage collector.

func NewUploadProcessingDuration

func NewUploadProcessingDuration() *Duration

NewUploadProcessingDuration returns a new Duration to be used for measuring the time taken to process an upload.

func (*Duration) Done

func (d *Duration) Done()

Done observes the duration as a metric. It should only be called once.

type Request

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

Request represents a monitoring request. To record a request, either create a new request with NewRequest or call Reset on an existing Request; then call Done when the request has completed.

func NewRequest

func NewRequest(method, root string) *Request

NewRequest returns a new monitoring request for monitoring a request within the given root. When the request is done, Done should be called.

func (*Request) Done

func (r *Request) Done()

Done records that the request is complete, and records any metrics for the request since the last call to Reset.

func (*Request) Kind

func (r *Request) Kind() string

Kind returns the kind that has been set. This is useful for testing.

func (*Request) Reset

func (r *Request) Reset(method, root string)

Reset resets r to indicate that a new request has started. The parameter holds the API root (for example the API version).

func (*Request) SetKind

func (r *Request) SetKind(kind string)

SetKind sets the kind of the request. This is an arbitrary string to classify different kinds of request.

Jump to

Keyboard shortcuts

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