Documentation ¶
Index ¶
- Constants
- Variables
- func Render() http.HandlerFunc
- type Collector
- type CollectorOptions
- type CollectorRegister
- type ConstLabels
- type Counter
- type CounterOptions
- type Desc
- type Descs
- type Gauge
- type GaugeOptions
- type Histogram
- type HistogramOptions
- type Metric
- type MetricErr
- type Metrics
- type Registry
- type ValueType
Constants ¶
View Source
const ( // CollectorPrefix ... CollectorPrefix = `prometheus` // FieldSeperator 域分隔符 FieldSeperator = `__` )
View Source
const (
// WorkerCount 执行协程数量
WorkerCount = 5
)
Variables ¶
View Source
var ( // DefaultBuckets 默认 DefaultBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10} )
Functions ¶
Types ¶
type Collector ¶
type Collector interface { // Collect 收集指标值 Collect(ch chan<- *MetricErr) // Describe 指标描述 Describe() *Desc }
Collector ...
type CollectorOptions ¶
CollectorOptions 参数管理
type CollectorRegister ¶
type CollectorRegister interface { MustRegister(Collector) Register(Collector) error Unregister(Collector) }
CollectorRegister ...
type Counter ¶
type Counter interface { Collector Inc(context.Context, ConstLabels) IncBy(context.Context, float64, ConstLabels) }
Counter 计数器
type Gauge ¶
type Gauge interface { Collector Inc(context.Context, ConstLabels) IncBy(context.Context, float64, ConstLabels) Dec(context.Context, ConstLabels) DecBy(context.Context, float64, ConstLabels) Set(context.Context, float64, ConstLabels) }
Gauge dashboard
type Histogram ¶
type Histogram interface { Collector Observe(context.Context, float64, ConstLabels) Linear(start, width float64, count int) []float64 Exponential(start, factor float64, count int) []float64 }
Histogram 直方图
func NewHistogram ¶
func NewHistogram(rdb redis.Cmdable, opts HistogramOptions, buckets []float64) Histogram
NewHistogram ...
type Metric ¶
type Metric struct { Desc *Desc Value float64 // 指标值 ConstLabels ConstLabels // 常量标签值 }
Metric 指标
Source Files ¶
Click to show internal directories.
Click to hide internal directories.