metrics

package
v0.0.0-...-128afb8 Latest Latest
Warning

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

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

Documentation

Overview

Package metrics contains definition of metrics exposed by server/tq.

Index

Constants

View Source
const MaxRetryFieldValue = 10

MaxRetryFieldValue is the number to cap the value of retry count field at, for metrics that include it, thus indicating a value greater or equal to it. This makes the metric field have a reasonable number of distinct values.

Variables

View Source
var (
	InprocSweepDurationMS = metric.NewCumulativeDistribution(
		"tq/sweep/inproc/duration",
		"Duration of a full inproc sweep cycle across all DBs (ms)",
		&types.MetricMetadata{Units: types.Milliseconds},
		bucketer1msTo5min,
	)

	SweepFetchMetaDurationsMS = metric.NewCumulativeDistribution(
		"tq/sweep/fetch/meta/durations",
		"Duration of FetchRemindersMeta operation (ms)",
		&types.MetricMetadata{Units: types.Milliseconds},
		bucketer1msTo5min,
		field.String("status"),
		field.Int("level"),
		field.String("db"),
	)

	SweepFetchMetaReminders = metric.NewCounter(
		"tq/sweep/fetch/meta/reminders",
		"Count of Reminders fetched by FetchRemindersMeta",
		nil,
		field.String("status"),
		field.Int("level"),
		field.String("db"),
	)

	ReminderStalenessMS = metric.NewCumulativeDistribution(
		"tq/reminders/staleness",
		("Distribution of staleness of scanned Reminders during the sweep. " +
			"May be incomplete if keyspace wasn't scanned completely"),
		&types.MetricMetadata{Units: types.Milliseconds},
		distribution.DefaultBucketer,
		field.Int("level"),
		field.String("db"),
	)

	RemindersCreated = metric.NewCounter(
		"tq/reminders/created",
		"Count of reminders created and if they are still fresh in the post-txn defer",
		nil,
		field.String("task_class"),
		field.String("staleness"),
		field.String("db"),
	)

	RemindersDeleted = metric.NewCounter(
		"tq/reminders/processed",
		"Count of reminders processed (i.e. deleted)",
		nil,
		field.String("task_class"),
		field.String("txn_path"),
		field.String("db"),
	)

	RemindersLatencyMS = metric.NewCumulativeDistribution(
		"tq/reminders/latency",
		"Time between AddTask call and the deletion of the reminder",
		&types.MetricMetadata{Units: types.Milliseconds},
		bucketer1msTo5min,
		field.String("task_class"),
		field.String("txn_path"),
		field.String("db"),
	)

	SubmitCount = metric.NewCounter(
		"tq/submit/count",
		"Count of submitted tasks",
		nil,
		field.String("task_class"),
		field.String("queue"),
		field.String("txn_path"),
		field.String("grpc_code"),
	)

	SubmitDurationMS = metric.NewCumulativeDistribution(
		"tq/submit/duration",
		"Duration of submit calls",
		&types.MetricMetadata{Units: types.Milliseconds},
		distribution.DefaultBucketer,
		field.String("task_class"),
		field.String("queue"),
		field.String("txn_path"),
		field.String("grpc_code"),
	)

	ServerRejectedCount = metric.NewCounter(
		"tq/server/rejected",
		"Count of rejected (e.g. malformed) task pushes",
		nil,
		field.String("queue"),
		field.String("reason"),
	)

	ServerHandledCount = metric.NewCounter(
		"tq/server/handled",
		"Count of handled non-rejected tasks",
		nil,
		field.String("task_class"),
		field.String("queue"),
		field.String("result"),
		field.Int("retry"),
	)

	ServerDurationMS = metric.NewCumulativeDistribution(
		"tq/server/duration",
		"Duration of handling of non-rejected tasks",
		&types.MetricMetadata{Units: types.Milliseconds},
		distribution.DefaultBucketer,
		field.String("task_class"),
		field.String("queue"),
		field.String("result"),
	)

	ServerTaskLatency = metric.NewCumulativeDistribution(
		"tq/server/latency",
		"Time between task's expected ETA and actual completion",
		&types.MetricMetadata{Units: types.Milliseconds},
		distribution.DefaultBucketer,
		field.String("task_class"),
		field.String("queue"),
		field.String("result"),
		field.Int("retry"),
	)

	ServerRunning = metric.NewInt(
		"tq/server/running",
		"Number of task handlers currently running",
		nil,
		field.String("task_class"),
	)
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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