Documentation
¶
Overview ¶
metrics/aggregator.go
metrics/collector.go
metrics/types.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateRule ¶
type AggregateRule struct { Name string Type MetricType Operation AggregateOperation Window time.Duration Quantiles []float64 }
AggregateRule 聚合规则
type CollectorOptions ¶
type CollectorOptions struct { // 缓冲区大小 BufferSize int // 工作池大小 WorkerSize int // 采样率 SampleRate float64 // 刷新间隔 FlushInterval time.Duration // 存储选项 StorageOptions StorageOptions // 聚合选项 AggregateOptions AggregateOptions // 报告选项 ReportOptions ReportOptions }
CollectorOptions 收集器配置
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram 直方图实现
func NewHistogram ¶
func NewHistogram(opts HistogramOpts) *Histogram
type HistogramOpts ¶
HistogramOpts 直方图配置
type MetricAggregator ¶
type MetricAggregator struct {
// contains filtered or unexported fields
}
MetricAggregator 指标聚合器
func (*MetricAggregator) Aggregate ¶
func (ma *MetricAggregator) Aggregate(metric Metric) (*AggregateResult, error)
type MetricBucket ¶
type MetricBucket struct {
// contains filtered or unexported fields
}
MetricBucket 指标桶
type MetricCollector ¶
type MetricCollector struct {
// contains filtered or unexported fields
}
MetricCollector 指标收集器
func NewMetricCollector ¶
func NewMetricCollector(opts CollectorOptions) (*MetricCollector, error)
NewMetricCollector 创建指标收集器
func (*MetricCollector) RegisterMetric ¶
func (mc *MetricCollector) RegisterMetric(name string, typ MetricType, labels map[string]string) (Metric, error)
RegisterMetric 注册指标
type MetricType ¶
type MetricType string
MetricType 指标类型
const ( CounterMetric MetricType = "counter" // 计数器类型 GaugeMetric MetricType = "gauge" // 仪表类型 HistogramMetric MetricType = "histogram" // 直方图类型 SummaryMetric MetricType = "summary" // 摘要类型 )
type MetricValue ¶
MetricValue 指标值接口
type TimeWindow ¶
type TimeWindow struct {
// contains filtered or unexported fields
}
TimeWindow 时间窗口
Click to show internal directories.
Click to hide internal directories.