Documentation
¶
Index ¶
- Constants
- Variables
- func ExponentialBuckets(start, factor float64, count int) []float64
- func InitMetric(ieFactory func() ie.InternalExecutor, pu *config.ParameterUnit, nodeId int, ...)
- func NewCounter(opts prom.CounterOpts) *ratecounter
- func NewCounterVec(opts CounterOpts, lvs []string) *rateCounterVec
- func NewGauge(opts prom.GaugeOpts) *gauge
- func NewGaugeVec(opts prom.GaugeOpts, lvs []string) *gaugeVec
- func NewRawHist(opts prom.HistogramOpts) *rawHist
- func StopMetricSync()
- type Collector
- type Counter
- type CounterOpts
- type Gauge
- type GaugeOpts
- type HistogramOpts
- type MetricCollector
- type MetricExporter
- type Observer
- type RawHistVec
- func (r *RawHistVec) CancelToProm()
- func (v *RawHistVec) Collect(ch chan<- prom.Metric)
- func (r *RawHistVec) CollectorToProm() prom.Collector
- func (v *RawHistVec) Describe(ch chan<- *prom.Desc)
- func (v *RawHistVec) GetMetricWithLabelValues(lvs ...string) (Observer, error)
- func (v *RawHistVec) WithLabelValues(lvs ...string) prom.Observer
- type SQLType
- type WithFlushInterval
- type WithMetricThreshold
- type WithSampleThreshold
- type WithSqlWorkerNum
Constants ¶
View Source
const ( CacheKey_MemStats cacheKey = iota CacheKey_Process )
View Source
const ( METRIC_DB = "system_metrics" SQL_CREATE_DB = "create database if not exists " + METRIC_DB SQL_DROP_DB = "drop database if exists " + METRIC_DB ALL_IN_ONE_MODE = "monolithic" )
View Source
const CHAN_CAPACITY = 10000
Variables ¶
View Source
var ( StatementCounterFactory = NewCounterVec( CounterOpts{ Subsystem: "sql", Name: "statement_total", Help: "Counter of executed sql statement", }, []string{"type", "internal"}, ) SQLLatencyObserverFactory = NewRawHistVec( HistogramOpts{ Subsystem: "sql", Name: "latency_seconds", Help: "Processing time in seconds of handled sql statement", Buckets: ExponentialBuckets(0.0005, 2, 28), }, []string{"type", "internal"}, ) )
View Source
var ( LBL_NODE = "node" LBL_ROLE = "role" LBL_VALUE = "value" LBL_TIME = "collecttime" )
View Source
var HardwareStatsCollector = newBatchStatsCollector(
cpuTotal{},
cpuPercent{},
memUsed{},
memAvail{},
)
View Source
var ProcessCollector = newBatchStatsCollector(procCpuPercent{}, procMemUsage{}, procOpenFds{}, procFdsLimit{})
Functions ¶
func ExponentialBuckets ¶
ExponentialBuckets produces list like `[start, start * factor, start * factor^2, ..., start * factor^(count-1)]`
func InitMetric ¶
func InitMetric(ieFactory func() ie.InternalExecutor, pu *config.ParameterUnit, nodeId int, role string)
func NewCounter ¶
func NewCounter(opts prom.CounterOpts) *ratecounter
func NewCounterVec ¶
func NewCounterVec(opts CounterOpts, lvs []string) *rateCounterVec
func NewGaugeVec ¶
func NewRawHist ¶
func NewRawHist(opts prom.HistogramOpts) *rawHist
func StopMetricSync ¶
func StopMetricSync()
Types ¶
type Counter ¶
func StatementCounter ¶
type CounterOpts ¶
type CounterOpts = prom.CounterOpts
type HistogramOpts ¶
type HistogramOpts = prom.HistogramOpts
type MetricCollector ¶
type MetricExporter ¶
type Observer ¶
func SQLLatencyObserver ¶
type RawHistVec ¶
type RawHistVec struct {
// contains filtered or unexported fields
}
RawHistVec is a Collector that bundles a set of RawHist that all share the same Desc, but have different values for their variable labels. It can be used as a factory for a series of Observers
func NewRawHistVec ¶
func NewRawHistVec(opts prom.HistogramOpts, labelNames []string) *RawHistVec
NewRawHistVec creates a new NewRawHistVec based on the provided HistogramOpts and partitioned by the given label names.
func (*RawHistVec) CancelToProm ¶
func (r *RawHistVec) CancelToProm()
func (*RawHistVec) Collect ¶
func (v *RawHistVec) Collect(ch chan<- prom.Metric)
func (*RawHistVec) CollectorToProm ¶
func (r *RawHistVec) CollectorToProm() prom.Collector
func (*RawHistVec) Describe ¶
func (v *RawHistVec) Describe(ch chan<- *prom.Desc)
func (*RawHistVec) GetMetricWithLabelValues ¶
func (v *RawHistVec) GetMetricWithLabelValues(lvs ...string) (Observer, error)
func (*RawHistVec) WithLabelValues ¶
func (v *RawHistVec) WithLabelValues(lvs ...string) prom.Observer
type WithFlushInterval ¶
func (WithFlushInterval) ApplyTo ¶
func (x WithFlushInterval) ApplyTo(o *collectorOpts)
type WithMetricThreshold ¶
type WithMetricThreshold int
func (WithMetricThreshold) ApplyTo ¶
func (x WithMetricThreshold) ApplyTo(o *collectorOpts)
type WithSampleThreshold ¶
type WithSampleThreshold int
func (WithSampleThreshold) ApplyTo ¶
func (x WithSampleThreshold) ApplyTo(o *collectorOpts)
type WithSqlWorkerNum ¶
type WithSqlWorkerNum int
func (WithSqlWorkerNum) ApplyTo ¶
func (x WithSqlWorkerNum) ApplyTo(o *collectorOpts)
Click to show internal directories.
Click to hide internal directories.