Documentation ¶
Index ¶
Constants ¶
View Source
const ( StatusOK int8 = iota StatusERR StatusMax )
View Source
const ( MetricsChannelBuff = 30000 MetricsCollectInterval = 30 MetricsGatherDBBuffSize = 300 MetricsCostBucketSize = 100 MetricsCostBucketMaxValue = 200 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct { ServerExporter // contains filtered or unexported fields }
func NewExporter ¶
func (*Exporter) Collect ¶
func (exporter *Exporter) Collect(ch chan<- prometheus.Metric)
Implements prometheus.Collector.
func (*Exporter) Describe ¶
func (exporter *Exporter) Describe(ch chan<- *prometheus.Desc)
Implements prometheus.Collector.
type MetricsGather ¶
type MetricsGather struct {
// contains filtered or unexported fields
}
type MetricsInfo ¶
type MetricsInfo struct { Name string `json:"name"` Status string `json:"status"` QPS float32 `json:"qps"` Total int `json:"total"` AvgCost float64 `json:"avg_cost"` MaxCost float64 `json:"max_cost"` AvgCounter float32 `json:"avg_counter"` Counter float32 `json:"counter"` CostBucket map[float64]uint64 `json:"-"` }
func (*MetricsInfo) String ¶
func (info *MetricsInfo) String() string
type MetricsInstance ¶
type MetricsInstance struct {
// contains filtered or unexported fields
}
func (*MetricsInstance) AddItem ¶
func (mInstance *MetricsInstance) AddItem(mi *MetricsItem)
func (*MetricsInstance) GetMetricsInfo ¶
func (mInstance *MetricsInstance) GetMetricsInfo() []MetricsInfo
type MetricsItem ¶
type MetricsItem struct {
// contains filtered or unexported fields
}
func NewCounterStat ¶
func NewCounterStat(name string, counter int) *MetricsItem
func NewStat ¶
func NewStat(name string) *MetricsItem
func (*MetricsItem) End ¶
func (mi *MetricsItem) End()
func (*MetricsItem) MarkErr ¶
func (mi *MetricsItem) MarkErr() *MetricsItem
func (*MetricsItem) MarkOk ¶
func (mi *MetricsItem) MarkOk() *MetricsItem
func (*MetricsItem) SampleRate ¶
func (mi *MetricsItem) SampleRate(rate float32) *MetricsItem
func (*MetricsItem) SetCounter ¶
func (mi *MetricsItem) SetCounter(counter int) *MetricsItem
type ServerExporter ¶
type ServerExporter struct {
// contains filtered or unexported fields
}
func NewServerExporter ¶
func NewServerExporter(namespace string) *ServerExporter
func (*ServerExporter) Describe ¶
func (serverE *ServerExporter) Describe(ch chan<- *prometheus.Desc)
Click to show internal directories.
Click to hide internal directories.