metricsRedis

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

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PingUnknown = -1
	PingDown    = 0
	PingUp      = 1

	GetFailed = -1

	MetricPrefix = "redis."
)

Variables

View Source
var (
	MetricKeys = []string{

		"connected_clients",
		"client_longest_output_list",
		"client_biggest_input_buf",
		"blocked_clients",

		"used_memory",

		"used_memory_rss",
		"used_memory_peak",

		"used_memory_lua",
		"mem_fragmentation_ratio",

		"loading",
		"rdb_changes_since_last_save",
		"rdb_bgsave_in_progress",
		"rdb_last_save_time",
		"rdb_last_bgsave_time_sec",
		"rdb_current_bgsave_time_sec",
		"aof_enabled",
		"aof_rewrite_in_progress",
		"aof_rewrite_scheduled",
		"aof_last_rewrite_time_sec",
		"aof_current_rewrite_time_sec",

		"total_connections_received",
		"total_commands_processed",
		"instantaneous_ops_per_sec",
		"total_net_input_bytes",
		"total_net_output_bytes",
		"instantaneous_input_kbps",
		"instantaneous_output_kbps",
		"rejected_connections",
		"sync_full",
		"sync_partial_ok",
		"sync_partial_err",
		"expired_keys",
		"evicted_keys",
		"keyspace_hits",
		"keyspace_misses",
		"pubsub_channels",
		"pubsub_patterns",
		"latest_fork_usec",
		"migrate_cached_sockets",

		"connected_slaves",
		"master_repl_offset",
		"repl_backlog_active",
		"repl_backlog_size",
		"repl_backlog_first_byte_offset",
		"repl_backlog_histlen",

		"used_cpu_sys",
		"used_cpu_user",
		"used_cpu_sys_children",
		"used_cpu_user_children",

		"cluster_enabled",
	}

	MetricCounterTypes = map[string]string{}/* 149 elements not displayed */

	DefaultMetricCounterType = "GAUGE"
)
View Source
var (
	ConnPools = make(map[string]*redis.Client)
)

Functions

func ComputingUsedMemoryRate

func ComputingUsedMemoryRate(m *map[string]interface{}) (rate int, err error)

func GetClusterInfo

func GetClusterInfo(addr, password string) (*map[string]interface{}, error)

func GetClusterInfoByPool

func GetClusterInfoByPool(addr, password string) (*map[string]interface{}, error)

func GetConnPools

func GetConnPools() *map[string]*redis.Client

func GetCounterType

func GetCounterType(key string) string

func GetInfoByPool

func GetInfoByPool(addr, password string) (*map[string]interface{}, error)

func GetInfoCommandStatsByPool

func GetInfoCommandStatsByPool(addr, password string) (*map[string]interface{}, error)

func Gets

func Gets(addr, password string) (*map[string]interface{}, error)

func ParseCommandStatsInfo

func ParseCommandStatsInfo(reply *string, result *map[string]interface{})

func ParseReplyClusterInfo

func ParseReplyClusterInfo(reply *string, result *map[string]interface{})

func ParseReplyInfo

func ParseReplyInfo(reply *string, result *map[string]interface{})

func SliceIndex

func SliceIndex(limit int, predicate func(i int) bool) int

SliceIndex a generic function in idiomatic. See https://stackoverflow.com/questions/8307478/how-to-find-out-element-position-in-slice

Types

This section is empty.

Jump to

Keyboard shortcuts

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