Documentation ¶
Index ¶
- Constants
- Variables
- func BuildVersionGreaterThanOrEqual(rawMetrics map[string]string, ref string) (bool, error)
- func GetMetricType(pContext commons.ContextType, pRawMetricName string) commons.MetricType
- type AerospikeStat
- type LatencyInfoParser
- type LatencyStatsMap
- type LatencyStatsProcessor
- type NamespaceStatsProcessor
- type NodeStatsProcessor
- type SetsStatsProcessor
- type SindexStatsProcessor
- type StatProcessor
- type UserStatsProcessor
- type XdrStatsProcessor
Constants ¶
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" )
const ( KEY_SERVICE_CONFIG = "get-config:context=service" KEY_SERVICE_STATISTICS = "statistics" )
const ( KEY_XDR_METADATA = "get-config:context=xdr" KEY_XDR_STAT = "get-stats:context=xdr;dc=" KEY_XDR_CONFIG = "get-config:context=xdr;dc=" )
const ( INFOKEY_SERVICE_CLEAR_STD = "service-clear-std" INFOKEY_SERVICE_TLS_STD = "service-tls-std" )
const (
KEY_SETS = "sets"
)
Variables ¶
var ( Infokey_ClusterName = "cluster-name" Infokey_Service = INFOKEY_SERVICE_CLEAR_STD Infokey_Build = "build" )
Default info commands
var ( // Regex for indentifying globbing patterns (or standard wildcards) in the metrics allowlist and blocklist. GlobbingPattern = regexp.MustCompile(`\[|\]|\*|\?|\{|\}|\\|!`) )
var NamespaceLatencyBenchmarks = make(map[string]map[string]string)
var PREFIX_AEROSPIKE = "aerospike_"
this is used as a prefix to qualify a metric while pushing to Prometheus or something
var (
// Node service endpoint, cluster name and build version
Service, ClusterName, Build string
)
var ServiceLatencyBenchmarks = make(map[string]string)
Functions ¶
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 ¶
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
type LatencyStatsMap ¶
type LatencyStatsMap map[string]interface{}
func (LatencyStatsMap) Get ¶
func (s LatencyStatsMap) Get(name string, aliases ...string) interface{}
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