Documentation
¶
Overview ¶
Package redis contains shared Redis functionality for the metric sets
Index ¶
- Constants
- func AssetRedis() string
- func FetchKeyInfo(c rd.Conn, key string) (map[string]interface{}, error)
- func FetchKeys(c rd.Conn, pattern string, limit uint) ([]string, error)
- func FetchRedisInfo(stat string, c rd.Conn) (map[string]string, error)
- func FetchSlowLogLength(c rd.Conn) (int64, error)
- func ParseRedisInfo(info string) map[string]string
- func ParseRedisLine(s string, delimiter string) []string
- func Select(c rd.Conn, keyspace uint) error
- type MetricSet
- type Pool
Constants ¶
const ( TypeNone = "none" TypeString = "string" TypeList = "list" TypeSet = "set" TypeSortedSet = "zset" TypeHash = "hash" )
Redis types
Variables ¶
This section is empty.
Functions ¶
func AssetRedis ¶
func AssetRedis() string
AssetRedis returns asset data. This is the base64 encoded gzipped contents of ../metricbeat/module/redis.
func FetchKeyInfo ¶
FetchKeyInfo collects info about a key
func FetchKeys ¶
FetchKeys gets a list of keys based on a pattern using SCAN, `limit` is a safeguard to limit the number of commands executed and the number of keys returned, if more than `limit` keys are being collected the method stops and returns the keys already collected. Setting `limit` to ' disables this limit.
func FetchRedisInfo ¶
FetchRedisInfo returns a map of requested stats.
func FetchSlowLogLength ¶
FetchSlowLogLength returns count of slow operations
func ParseRedisInfo ¶
ParseRedisInfo parses the string returned by the INFO command Every line is split up into key and value
func ParseRedisLine ¶
ParseRedisLine parses a single line returned by INFO
Types ¶
type MetricSet ¶
type MetricSet struct { mb.BaseMetricSet // contains filtered or unexported fields }
MetricSet for fetching Redis server information and statistics.
func NewMetricSet ¶
func NewMetricSet(base mb.BaseMetricSet) (*MetricSet, error)
NewMetricSet creates the base for Redis metricsets
func (*MetricSet) Connection ¶
Connection returns a redis connection from the pool
func (*MetricSet) OriginalDBNumber ¶
OriginalDBNumber returns the originally configured database number, this can be used by metricsets that change keyspace to go back to the originally configured one