Documentation
¶
Index ¶
- Constants
- func Collector(errChannel chan<- error) prometheus.Collector
- func Set(key string, value float64, labelValues ...string)
- func StartMetrics(errChannel chan<- error)
- type CounterMetric
- func (m *CounterMetric) GetLabelValues() []string
- func (m *CounterMetric) GetValue() float64
- func (m *CounterMetric) GetValueType() prometheus.ValueType
- func (m *CounterMetric) SetLabelValues(values []string)
- func (m *CounterMetric) SetValue(v float64)
- func (m *CounterMetric) SetValueType(prometheus.ValueType)
- type ExportMetric
- type GaugeMetric
- type ImmutableGaugeMetric
- func (m *ImmutableGaugeMetric) GetLabelValues() []string
- func (m *ImmutableGaugeMetric) GetValue() float64
- func (m *ImmutableGaugeMetric) GetValueType() prometheus.ValueType
- func (m *ImmutableGaugeMetric) SetLabelValues(values []string)
- func (m *ImmutableGaugeMetric) SetValue(v float64)
- func (m *ImmutableGaugeMetric) SetValueType(prometheus.ValueType)
- type MetricConfig
- type TickerGaugeMetric
- func (m *TickerGaugeMetric) GetLabelValues() []string
- func (m *TickerGaugeMetric) GetValue() float64
- func (m *TickerGaugeMetric) GetValueType() prometheus.ValueType
- func (m *TickerGaugeMetric) Init()
- func (m *TickerGaugeMetric) SetLabelValues(values []string)
- func (m *TickerGaugeMetric) SetValue(v float64)
- func (m *TickerGaugeMetric) SetValueType(prometheus.ValueType)
Constants ¶
const ( KeyPrefix = "cassini_" KeyQueueSize = "queue_size" KeyQueue = "queue" KeyAdaptors = "adaptors" KeyTxsWait = "txs_wait" KeyTxCost = "tx_cost" KeyTxsPerSecond = "txs_per_second" KeyErrors = "errors" )
nolint
const (
// KeyMetricType config key
KeyMetricType = "metricType"
)
Variables ¶
This section is empty.
Functions ¶
func Collector ¶
func Collector(errChannel chan<- error) prometheus.Collector
Collector returns a collector which exports metrics about status code of network service response
func StartMetrics ¶
func StartMetrics(errChannel chan<- error)
StartMetrics prometheus exporter("/metrics") service
Types ¶
type CounterMetric ¶
type CounterMetric struct {
// contains filtered or unexported fields
}
CounterMetric stores a counter value
func (*CounterMetric) GetLabelValues ¶
func (m *CounterMetric) GetLabelValues() []string
GetLabelValues returns label values
func (*CounterMetric) GetValueType ¶
func (m *CounterMetric) GetValueType() prometheus.ValueType
GetValueType returns value type
func (*CounterMetric) SetLabelValues ¶
func (m *CounterMetric) SetLabelValues(values []string)
SetLabelValues sets label values
func (*CounterMetric) SetValueType ¶
func (m *CounterMetric) SetValueType(prometheus.ValueType)
SetValueType sets nothing
type ExportMetric ¶
type ExportMetric interface { GetValue() float64 SetValue(float64) GetValueType() prometheus.ValueType SetValueType(prometheus.ValueType) GetLabelValues() []string SetLabelValues([]string) }
ExportMetric defined an interface about prometheus exporter metric
type GaugeMetric ¶
type GaugeMetric struct {
// contains filtered or unexported fields
}
GaugeMetric wraps prometheus export data
func (*GaugeMetric) GetLabelValues ¶
func (m *GaugeMetric) GetLabelValues() []string
GetLabelValues returns label values
func (*GaugeMetric) GetValueType ¶
func (m *GaugeMetric) GetValueType() prometheus.ValueType
GetValueType returns value type
func (*GaugeMetric) SetLabelValues ¶
func (m *GaugeMetric) SetLabelValues(values []string)
SetLabelValues sets label values
func (*GaugeMetric) SetValueType ¶
func (m *GaugeMetric) SetValueType(prometheus.ValueType)
SetValueType sets nothing
type ImmutableGaugeMetric ¶
type ImmutableGaugeMetric struct {
// contains filtered or unexported fields
}
ImmutableGaugeMetric stores an immutable value
func (*ImmutableGaugeMetric) GetLabelValues ¶
func (m *ImmutableGaugeMetric) GetLabelValues() []string
GetLabelValues returns label values
func (*ImmutableGaugeMetric) GetValue ¶
func (m *ImmutableGaugeMetric) GetValue() float64
GetValue returns value
func (*ImmutableGaugeMetric) GetValueType ¶
func (m *ImmutableGaugeMetric) GetValueType() prometheus.ValueType
GetValueType returns value type
func (*ImmutableGaugeMetric) SetLabelValues ¶
func (m *ImmutableGaugeMetric) SetLabelValues(values []string)
SetLabelValues sets label values
func (*ImmutableGaugeMetric) SetValue ¶
func (m *ImmutableGaugeMetric) SetValue(v float64)
SetValue sets value
func (*ImmutableGaugeMetric) SetValueType ¶
func (m *ImmutableGaugeMetric) SetValueType(prometheus.ValueType)
SetValueType sets nothing
type MetricConfig ¶
MetricConfig defined config about metric type
type TickerGaugeMetric ¶
type TickerGaugeMetric struct {
// contains filtered or unexported fields
}
TickerGaugeMetric wraps prometheus export data with ticker job
func (*TickerGaugeMetric) GetLabelValues ¶
func (m *TickerGaugeMetric) GetLabelValues() []string
GetLabelValues returns label values
func (*TickerGaugeMetric) GetValue ¶
func (m *TickerGaugeMetric) GetValue() float64
GetValue returns value
func (*TickerGaugeMetric) GetValueType ¶
func (m *TickerGaugeMetric) GetValueType() prometheus.ValueType
GetValueType returns value type
func (*TickerGaugeMetric) SetLabelValues ¶
func (m *TickerGaugeMetric) SetLabelValues(values []string)
SetLabelValues sets label values
func (*TickerGaugeMetric) SetValue ¶
func (m *TickerGaugeMetric) SetValue(v float64)
SetValue sets value
func (*TickerGaugeMetric) SetValueType ¶
func (m *TickerGaugeMetric) SetValueType(prometheus.ValueType)
SetValueType sets nothing