metrics

package
v0.0.0-...-1a0a9e8 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CoresToMillicores               int = 1000
	SecondsToMillisecondsMultiplier int = 1000
	BytesToMegabytesMultiplier      int = 1000 * 1000
	BytesToGigabytesMultiplier      int = BytesToMegabytesMultiplier * 1000

	GigabytesUnit    = gmeasure.Units("GB")
	MillicoresUnit   = gmeasure.Units("m")
	MillisecondsUnit = gmeasure.Units("ms")

	StreamsUnit           = gmeasure.Units("streams")
	QueriesPerSecondUnit  = gmeasure.Units("queries per second")
	RequestsPerSecondUnit = gmeasure.Units("requests per second")

	DistributorAnnotation   = gmeasure.Annotation("distributor")
	IngesterAnnotation      = gmeasure.Annotation("ingester")
	QuerierAnnotation       = gmeasure.Annotation("querier")
	QueryFrontendAnnotation = gmeasure.Annotation("query-frontend")
	IndexGatewayAnnotation  = gmeasure.Annotation("index-gateway")
)
View Source
const (
	HTTPGetMethod  = "GET"
	HTTPPostMethod = "POST"

	HTTPPushRoute       = "loki_api_v1_push"
	HTTPQueryRangeRoute = "loki_api_v1_query_range"
	HTTPReadPathRoutes  = "" /* 182-byte string literal not displayed */
)
View Source
const (
	GRPCMethod = "gRPC"

	GRPCPushRoute        = "/logproto.Pusher/Push"
	GRPCQuerySampleRoute = "/logproto.Querier/QuerySample"
	GRPCReadPathRoutes   = "" /* 132-byte string literal not displayed */
)
View Source
const (
	BoltDBShipperReadName  = "BoltDB Shipper successful reads"
	BoltDBShipperWriteName = "BoltDB Shipper successful writes"

	BoltDBReadOperation  = "Shipper.Query"
	BoltDBWriteOperation = "WRITE"
)
View Source
const (
	SecondsPerDay int = 60 * 60 * 24

	MegabytesPerSecondUnit = gmeasure.Units("MBps")
	GigabytesPerDayUnit    = gmeasure.Units("GBpd")

	LoadGeneratorAnnotation = gmeasure.Annotation("generator")
)
View Source
const (
	DefaultPercentile = 95
)
View Source
const (
	LogQLAnnotation = gmeasure.Annotation("logql")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(url, token string, timeout time.Duration, cadvisorEnabled bool) (*Client, error)

func (*Client) Measure

func (c *Client) Measure(e *gmeasure.Experiment, data Measurement) error

func (*Client) MeasureBoltDBShipperRequestMetrics

func (c *Client) MeasureBoltDBShipperRequestMetrics(
	e *gmeasure.Experiment,
	path RequestPath,
	job string,
	sampleRange model.Duration,
) error

func (*Client) MeasureGRPCRequestMetrics

func (c *Client) MeasureGRPCRequestMetrics(
	e *gmeasure.Experiment,
	path RequestPath,
	job string,
	sampleRange model.Duration,
	annotation gmeasure.Annotation,
) error

func (*Client) MeasureHTTPRequestMetrics

func (c *Client) MeasureHTTPRequestMetrics(
	e *gmeasure.Experiment,
	path RequestPath,
	job string,
	sampleRange model.Duration,
	annotation gmeasure.Annotation,
) error

func (*Client) MeasureIngestionVerificationMetrics

func (c *Client) MeasureIngestionVerificationMetrics(
	e *gmeasure.Experiment,
	deployment string,
	sampleRange model.Duration,
) error

func (*Client) MeasureLoadQuerierMetrics

func (c *Client) MeasureLoadQuerierMetrics(
	e *gmeasure.Experiment,
	sampleRange model.Duration,
) error

func (*Client) MeasureQueryMetrics

func (c *Client) MeasureQueryMetrics(
	e *gmeasure.Experiment,
	job string,
	sampleRange model.Duration,
	annotation gmeasure.Annotation,
) error

func (*Client) MeasureResourceUsageMetrics

func (c *Client) MeasureResourceUsageMetrics(
	e *gmeasure.Experiment,
	job string,
	sampleRange model.Duration,
	annotation gmeasure.Annotation,
) error

func (*Client) MeasureVolumeUsageMetrics

func (c *Client) MeasureVolumeUsageMetrics(
	e *gmeasure.Experiment,
	job string,
	sampleRange model.Duration,
	annotation gmeasure.Annotation,
) error

type Measurement

type Measurement struct {
	Name       string
	Query      string
	Unit       gmeasure.Units
	Annotation gmeasure.Annotation
}

func ContainerCPU

func ContainerCPU(job string, duration model.Duration, annotation gmeasure.Annotation) Measurement

func ContainerMemoryWorkingSetBytes

func ContainerMemoryWorkingSetBytes(job string, duration model.Duration, annotation gmeasure.Annotation) Measurement

func DistributorGiPDReceivedTotal

func DistributorGiPDReceivedTotal(duration model.Duration) Measurement

func LoadNetworkGiPDTotal

func LoadNetworkGiPDTotal(pod string, duration model.Duration) Measurement

func LoadNetworkTotal

func LoadNetworkTotal(pod string, duration model.Duration) Measurement

func LogQLQueryDurationAverage

func LogQLQueryDurationAverage(duration model.Duration) Measurement

func LogQLQueryDurationQuantile

func LogQLQueryDurationQuantile(percentile int, duration model.Duration) Measurement

func LogQLQueryLatencyAverage

func LogQLQueryLatencyAverage(
	code, pod string,
	duration model.Duration,
	annotation gmeasure.Annotation,
) Measurement

func LogQLQueryLatencyQuantile

func LogQLQueryLatencyQuantile(
	code, pod string,
	percentile int,
	duration model.Duration,
	annotation gmeasure.Annotation,
) Measurement

func LogQLQueryMBpSProcessedAverage

func LogQLQueryMBpSProcessedAverage(
	code, pod string,
	duration model.Duration,
	annotation gmeasure.Annotation,
) Measurement

func LogQLQueryMBpSProcessedQuantile

func LogQLQueryMBpSProcessedQuantile(
	code, pod string,
	percentile int,
	duration model.Duration,
	annotation gmeasure.Annotation,
) Measurement

func LogQLQueryRate

func LogQLQueryRate(duration model.Duration) Measurement

func LokiStreamsInMemoryTotal

func LokiStreamsInMemoryTotal(duration model.Duration) Measurement

func PersistentVolumeUsedBytes

func PersistentVolumeUsedBytes(job string, duration model.Duration, annotation gmeasure.Annotation) Measurement

func RequestBoltDBShipperRequestRate

func RequestBoltDBShipperRequestRate(name, job, operation, code string, duration model.Duration) Measurement

func RequestDurationAverage

func RequestDurationAverage(
	name, job, method, route, code string,
	duration model.Duration,
	annotation gmeasure.Annotation,
) Measurement

func RequestDurationQuantile

func RequestDurationQuantile(
	name, job, method, route, code string,
	percentile int,
	duration model.Duration,
	annotation gmeasure.Annotation,
) Measurement

func RequestRate

func RequestRate(
	name, job, route, code string,
	duration model.Duration,
	annotation gmeasure.Annotation,
) Measurement

type RequestPath

type RequestPath int
const (
	WriteRequestPath RequestPath = iota
	ReadRequestPath
)

Jump to

Keyboard shortcuts

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