metrics

package
v0.0.0-...-2bf1e3b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderPrometheus

func RenderPrometheus(w io.Writer, prefix string, metrics map[string]Metrics)

Renders the various metrics into a prometheus 0.0.4 compatible output.

Types

type MetricFailedSuccessTotal

type MetricFailedSuccessTotal struct {
	Failures  int64
	Successes int64
	Total     int64
}

Several metric types have a concept of a counter of total attempts, along with successful and error responses.

func (*MetricFailedSuccessTotal) CopyFrom

Copies the data in the given object into the current object.

func (*MetricFailedSuccessTotal) IncFailures

func (m *MetricFailedSuccessTotal) IncFailures()

func (*MetricFailedSuccessTotal) IncSuccesses

func (m *MetricFailedSuccessTotal) IncSuccesses()

func (*MetricFailedSuccessTotal) IncTotal

func (m *MetricFailedSuccessTotal) IncTotal()

type Metrics

type Metrics struct {
	// The total number of bytes that have been successfully ingested
	// into Primaries hosted by this storage instance.
	BytesInserted int64

	// Counts of files deleted on disk. This includes primaries and
	// replicas.
	FilesDeleted MetricFailedSuccessTotal

	// We also have a special set of metrics for tracking internally
	// generated and completely unexpected errors. Unlike Insert and
	// replication related metrics, which can return errors in cases
	// where the client has issues (short writes and tcp disconnects being
	// the most likely sources), these metrics track errors that can only
	// be generated by local system failures.
	InternalInsertErrors int64

	// Amount of time the oldest file has been queued for uploading (including
	// the time it takes to actually upload).
	OldestQueuedUpload float64

	// Age of oldest file that has not been uploaded to S3, in seconds:
	OldestUnUploadedData float64

	// Count of primaries that have been deleted.
	PrimaryDeletes MetricFailedSuccessTotal

	// Counts the total number of Insert operations.
	PrimaryInserts MetricFailedSuccessTotal

	// Counts the total number of nanoseconds that requests were queued
	// for before finding a primary file to insert into. This does not
	// include the time it took to actually perform the insert.
	PrimaryInsertQueueNanoseconds uint64

	// Counts the total number of nanoseconds that requests have spent
	// replicating to other instances.
	PrimaryInsertReplicateNanoseconds uint64

	// Counts the total number of nanoseconds that requests have spent
	// writing to local disk.
	PrimaryInsertWriteNanoseconds uint64

	// Counts of the primary open operations.
	PrimaryOpens MetricFailedSuccessTotal

	// Count of primaries that have been uploaded.
	PrimaryUploads MetricFailedSuccessTotal

	// The number of queued inserts.
	QueuedInserts int64

	// A pure count of replicas that have been queued for deleting.
	ReplicaDeletes MetricFailedSuccessTotal

	// Counts of replica HeartBeats
	ReplicaHeartBeats MetricFailedSuccessTotal

	// Counts of replica Initialize requests.
	ReplicaInitializes MetricFailedSuccessTotal

	// A pure count of the number of replicas that have been marked as
	// orphaned and therefor have moved into an uploading state.
	ReplicaOrphaned int64

	// Counts of replica QueueDeletes
	ReplicaQueueDeletes MetricFailedSuccessTotal

	// Counts of replica Replicates
	ReplicaReplicates MetricFailedSuccessTotal

	// Counts of replicas that have been Uploaded.
	ReplicaUploads MetricFailedSuccessTotal
}

When metrics are requested from a Storage implementation this structure will get returned. It contains counters and metrics specific to the running Storage implementation.

func (*Metrics) CopyFrom

func (m *Metrics) CopyFrom(m2 *Metrics)

Jump to

Keyboard shortcuts

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