observability

package
v2.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The measures to record metrics
	MBytesRead    = stats.Int64("redis/bytes_read", "The number of bytes read from the server", stats.UnitBytes)
	MBytesWritten = stats.Int64("redis/bytes_written", "The number of bytes written out to the server", stats.UnitBytes)
	MErrors       = stats.Int64("redis/errors", "The number of errors encountered", dimensionless)
	MWrites       = stats.Int64("redis/writes", "The number of write invocations", dimensionless)
	MReads        = stats.Int64("redis/reads", "The number of read invocations", dimensionless)

	MRoundtripLatencyMs = stats.Float64("redis/roundtrip_latency", "The latency in milliseconds of a method/operation", milliseconds)

	MConnectionsClosed = stats.Int64("redis/connections_closed", "The number of connections that have been closed", dimensionless)
	MConnectionsOpen   = stats.Int64("redis/connections_open", "The number of open connections", dimensionless)
)
View Source
var (
	// The tag keys to record alongside measures
	KeyCommandName, _ = tag.NewKey("cmd")
	KeyKind, _        = tag.NewKey("kind")
	KeyDetail, _      = tag.NewKey("detail")
	KeyState, _       = tag.NewKey("state")
)
View Source
var Views = []*view.View{
	{
		Name:        "redis/client/bytes_written",
		Description: "The distribution of bytes written out to the server",
		Aggregation: defaultBytesDistribution,
		Measure:     MBytesWritten,
		TagKeys:     []tag.Key{KeyCommandName},
	},
	{
		Name:        "redis/client/bytes_read",
		Description: "The distribution of bytes read from the server",
		Aggregation: defaultBytesDistribution,
		Measure:     MBytesRead,
		TagKeys:     []tag.Key{KeyCommandName},
	},
	{
		Name:        "redis/client/roundtrip_latency",
		Description: "The distribution of milliseconds of the roundtrip latencies for a Redis method invocation",
		Aggregation: defaultMillisecondsDistribution,
		Measure:     MRoundtripLatencyMs,
		TagKeys:     []tag.Key{KeyCommandName},
	},
	{
		Name:        "redis/client/writes",
		Description: "The number of write operations",
		Aggregation: view.Count(),
		Measure:     MWrites,
		TagKeys:     []tag.Key{KeyCommandName},
	},
	{
		Name:        "redis/client/reads",
		Description: "The number of read operations",
		Aggregation: view.Count(),
		Measure:     MReads,
		TagKeys:     []tag.Key{KeyCommandName},
	},
	{
		Name:        "redis/client/errors",
		Description: "The number of errors encountered",
		Aggregation: view.Count(),
		Measure:     MErrors,
		TagKeys:     []tag.Key{KeyCommandName, KeyDetail, KeyKind},
	},
	{
		Name:        "redis/client/connections_closed",
		Description: "The number of connections that have been closed, disambiguated by keys such as stale, idle, complete",
		Aggregation: view.Count(),
		Measure:     MConnectionsClosed,
		TagKeys:     []tag.Key{KeyState},
	},
	{
		Name:        "redis/client/connections_open",
		Description: "The number of open connections, but disambiguated by different states e.g. new, reused",
		Aggregation: view.Count(),
		Measure:     MConnectionsOpen,
		TagKeys:     []tag.Key{KeyState},
	},
}

Functions

func SinceInMilliseconds

func SinceInMilliseconds(startTime time.Time) float64

Types

This section is empty.

Jump to

Keyboard shortcuts

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