memcached

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricConfig

type MetricConfig struct {
	// Group is the memcached stats group that this stat comes from - which may be a blank string.
	Group string `json:"group"`
	// Pattern is the regular expression to match against all stats in the memcached Group.
	Pattern string `json:"pattern"`
	// Labels are the labels to apply to the Prometheus metric.
	// `bucket`, `scope`, and `collection` are treated specially. All other values are assumed to be named
	// capturing groups in Pattern.
	Labels []string `json:"labels"`
	// ConstLabels are constant labels to apply to the metric, in addition to Labels.
	ConstLabels prometheus.Labels `json:"constLabels"`
	// Help is the help string to add to the emitted Prometheus metric.
	Help string `json:"help,omitempty"`
	// Type is the type of metric to emit (counter, gauge, histogram, untyped). Defaults to untyped.
	Type common.MetricType `json:"type"`
	// Multiplier is a constant by which to multiply the resulting stats value.
	// For example, it can be used to fix values that are milliseconds in 6.0 but seconds in 7.0,
	// by setting a multiplier of 0.001.
	// If unset, defaults to 1 (no change).
	// NOTE: for histograms, the multiplier is applied to the *bounds*, not the values.
	Multiplier float64 `json:"multiplier"`
	// Singleton should be `true` for metrics that should only be emitted once.
	// This is necessary because the memcached protocol only allows gathering stats in the context of a bucket,
	// even for stats that are global.
	Singleton bool `json:"singleton"`
	// ResampleBuckets is only applicable for histograms.
	// It represents the bucket values that the original memcached buckets should be remapped to.
	ResampleBuckets []float64 `json:"resampleBuckets"`
}

type MetricConfigs

type MetricConfigs struct {
	Values []MetricConfig
}

MetricConfigs allows a JSON metric config to be either an object or an array.

func (*MetricConfigs) UnmarshalJSON

func (m *MetricConfigs) UnmarshalJSON(bytes []byte) error

type MetricSet

type MetricSet struct {
	Stats map[string]MetricConfigs `json:"stats"`
	// CommandTimings is the configuration for generating the kv_cmd_duration_seconds histogram.
	// It is a special case, as it requires different processing to the other memcached stats.
	CommandTimings *commandTimingMetricConfig `json:"commandTimings"`
}

MetricSet is a mapping of Prometheus metric names to MetricConfigs.

type Metrics

type Metrics struct {
	FakeCollections bool
	// contains filtered or unexported fields
}

func NewMemcachedMetrics

func NewMemcachedMetrics(logger *zap.Logger, node couchbase.NodeCommon, metricSet MetricSet) (*Metrics, error)

func (*Metrics) Close

func (m *Metrics) Close() error

func (*Metrics) Collect

func (m *Metrics) Collect(metrics chan<- prometheus.Metric)

func (*Metrics) Describe

func (m *Metrics) Describe(_ chan<- *prometheus.Desc)

Jump to

Keyboard shortcuts

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