statprocessors

package
v1.17.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KEY_NS_METADATA       = "namespaces"
	KEY_NS_INDEX_PRESSURE = "index-pressure"

	KEY_NS_NAMESPACE = "namespace"

	// values to compare while checking if refresh index-pressure or not
	TYPE_FLASH = "flash"
)
View Source
const (
	KEY_SERVICE_CONFIG     = "get-config:context=service"
	KEY_SERVICE_STATISTICS = "statistics"
)
View Source
const (
	KEY_XDR_METADATA = "get-config:context=xdr"
	KEY_XDR_STAT     = "get-stats:context=xdr;dc="
	KEY_XDR_CONFIG   = "get-config:context=xdr;dc="
)
View Source
const (
	INFOKEY_SERVICE_CLEAR_STD = "service-clear-std"
	INFOKEY_SERVICE_TLS_STD   = "service-tls-std"
)
View Source
const (
	KEY_SETS = "sets"
)

Variables

View Source
var (
	Infokey_ClusterName = "cluster-name"
	Infokey_Service     = INFOKEY_SERVICE_CLEAR_STD
	Infokey_Build       = "build"
)

Default info commands

View Source
var (
	// Regex for indentifying globbing patterns (or standard wildcards) in the metrics allowlist and blocklist.
	GlobbingPattern = regexp.MustCompile(`\[|\]|\*|\?|\{|\}|\\|!`)
)
View Source
var LatencyBenchmarks = make(map[string]string)
View Source
var PREFIX_AEROSPIKE = "aerospike_"

this is used as a prefix to qualify a metric while pushing to Prometheus or something

View Source
var (
	// Node service endpoint, cluster name and build version
	Service, ClusterName, Build string
)

Functions

func BuildVersionGreaterThanOrEqual

func BuildVersionGreaterThanOrEqual(rawMetrics map[string]string, ref string) (bool, error)

func GetMetricType

func GetMetricType(pContext commons.ContextType, pRawMetricName string) commons.MetricType

Validates if given stat is having - or defined in gauge-stat list, if not, return default metric-type (i.e. Counter)

Types

type AerospikeStat

type AerospikeStat struct {
	// type of metric, name and allow/disallow
	Context   commons.ContextType
	Name      string
	MType     commons.MetricType
	IsAllowed bool
	IsConfig  bool

	// Value, Label and Label values
	Value       float64
	Labels      []string
	LabelValues []string
}

func NewAerospikeStat

func NewAerospikeStat(pContext commons.ContextType, pStatName string, allowed bool) AerospikeStat

Utility, constructs a new AerospikeStat object with required checks like is-allowed, metric-type we are sending both stat-name sent by server and massaged stat-name to this, so allowed-regex is applied on original-server-stat-name very few stat-names will be message and are different from server-stat-name, like, storage-engine.file[1].defrag_q, storage-engine.stripe[0].defrag_writes

func Refresh

func Refresh() ([]AerospikeStat, error)

func RefreshSystemInfo

func RefreshSystemInfo() ([]AerospikeStat, error)

func (*AerospikeStat) QualifyMetricContext

func (as *AerospikeStat) QualifyMetricContext() string

*

  • prefixs a Context with Aerospike qualifier

type LatencyInfoParser

type LatencyInfoParser struct {
	*bufio.Reader
}

LatencyInfoParser provides a reader for Aerospike cluster's response for any of the metric

func NewInfoParser

func NewInfoParser(s string) *LatencyInfoParser

NewInfoParser provides an instance of the InfoParser

func (*LatencyInfoParser) Expect

func (ip *LatencyInfoParser) Expect(s string) error

Expect validates the expected value against the one returned by the InfoParser This advances the reader by length of the input string.

func (*LatencyInfoParser) PeekAndExpect

func (ip *LatencyInfoParser) PeekAndExpect(s string) error

PeekAndExpect checks if the expected value is present without advancing the reader

func (*LatencyInfoParser) ReadUntil

func (ip *LatencyInfoParser) ReadUntil(delim byte) (string, error)

ReadUntil reads bytes from the InfoParser by handeling some edge-cases

type LatencyStatsMap

type LatencyStatsMap map[string]interface{}

func (LatencyStatsMap) Get

func (s LatencyStatsMap) Get(name string, aliases ...string) interface{}

func (LatencyStatsMap) TryFloat

func (s LatencyStatsMap) TryFloat(name string, defValue float64, aliases ...string) float64

Value should be an float64 or a convertible string; otherwise defValue is returned this function never panics

func (LatencyStatsMap) TryString

func (s LatencyStatsMap) TryString(name string, defValue string, aliases ...string) string

Value should be an int64 or a convertible string; otherwise defValue is returned this function never panics

type LatencyStatsProcessor

type LatencyStatsProcessor struct {
}

func (*LatencyStatsProcessor) PassOneKeys

func (lw *LatencyStatsProcessor) PassOneKeys() []string

func (*LatencyStatsProcessor) PassTwoKeys

func (lw *LatencyStatsProcessor) PassTwoKeys(rawMetrics map[string]string) (latencyCommands []string)

func (*LatencyStatsProcessor) Refresh

func (lw *LatencyStatsProcessor) Refresh(infoKeys []string, rawMetrics map[string]string) ([]AerospikeStat, error)

type NamespaceStatsProcessor

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

func (*NamespaceStatsProcessor) PassOneKeys

func (nw *NamespaceStatsProcessor) PassOneKeys() []string

func (*NamespaceStatsProcessor) PassTwoKeys

func (nw *NamespaceStatsProcessor) PassTwoKeys(rawMetrics map[string]string) []string

func (*NamespaceStatsProcessor) Refresh

func (nw *NamespaceStatsProcessor) Refresh(infoKeys []string, rawMetrics map[string]string) ([]AerospikeStat, error)

type NodeStatsProcessor

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

func (*NodeStatsProcessor) PassOneKeys

func (sw *NodeStatsProcessor) PassOneKeys() []string

func (*NodeStatsProcessor) PassTwoKeys

func (sw *NodeStatsProcessor) PassTwoKeys(rawMetrics map[string]string) []string

func (*NodeStatsProcessor) Refresh

func (sw *NodeStatsProcessor) Refresh(infoKeys []string, rawMetrics map[string]string) ([]AerospikeStat, error)

type SetsStatsProcessor

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

func (*SetsStatsProcessor) PassOneKeys

func (sw *SetsStatsProcessor) PassOneKeys() []string

func (*SetsStatsProcessor) PassTwoKeys

func (sw *SetsStatsProcessor) PassTwoKeys(rawMetrics map[string]string) []string

func (*SetsStatsProcessor) Refresh

func (sw *SetsStatsProcessor) Refresh(infoKeys []string, rawMetrics map[string]string) ([]AerospikeStat, error)

type SindexStatsProcessor

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

func (*SindexStatsProcessor) PassOneKeys

func (siw *SindexStatsProcessor) PassOneKeys() []string

func (*SindexStatsProcessor) PassTwoKeys

func (siw *SindexStatsProcessor) PassTwoKeys(rawMetrics map[string]string) (sindexCommands []string)

func (*SindexStatsProcessor) Refresh

func (siw *SindexStatsProcessor) Refresh(infoKeys []string, rawMetrics map[string]string) ([]AerospikeStat, error)

type StatProcessor

type StatProcessor interface {
	PassOneKeys() []string
	PassTwoKeys(rawMetrics map[string]string) []string
	Refresh(infoKeys []string, rawMetrics map[string]string) ([]AerospikeStat, error)
}

func GetStatsProcessors

func GetStatsProcessors() []StatProcessor

type UserStatsProcessor

type UserStatsProcessor struct{}

func (*UserStatsProcessor) PassOneKeys

func (uw *UserStatsProcessor) PassOneKeys() []string

func (*UserStatsProcessor) PassTwoKeys

func (uw *UserStatsProcessor) PassTwoKeys(rawMetrics map[string]string) []string

func (*UserStatsProcessor) Refresh

func (uw *UserStatsProcessor) Refresh(infoKeys []string, rawMetrics map[string]string) ([]AerospikeStat, error)

type XdrStatsProcessor

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

func (*XdrStatsProcessor) PassOneKeys

func (xw *XdrStatsProcessor) PassOneKeys() []string

func (*XdrStatsProcessor) PassTwoKeys

func (xw *XdrStatsProcessor) PassTwoKeys(rawMetrics map[string]string) []string

func (*XdrStatsProcessor) Refresh

func (xw *XdrStatsProcessor) Refresh(infoKeys []string, rawMetrics map[string]string) ([]AerospikeStat, error)

refresh prom metrics - parse the given rawMetrics (both config and stats ) and push to given channel

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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