Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultSlowTime = int32(5)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BloomFilter ¶
func NewBloomFilter ¶
func NewBloomFilter() BloomFilter
type MetricType ¶
type MetricType int
const ( None MetricType = iota Counter Gauge Histogram Summary )
func (MetricType) Register ¶
func (m MetricType) Register(metric *metrics) error
type Metrics ¶
type Metrics interface {
SetGaugeValue(labelValues []string, value float64) error
Inc(labelValues []string) error
Add(labelValues []string, value float64) error
Observe(labelValues []string, value float64) error
Collect(c *gin.Context, start time.Time)
GetName() string
GetType() MetricType
SetDesc(desc string)
AddLabel(label ...string)
AddBuckets(bucket ...float64)
AddObjective(key, value float64)
SetCollect(fct FuncCollect)
}
func NewMetrics ¶
func NewMetrics(name string, metricType MetricType) Metrics
type Prometheus ¶
type Prometheus interface {
Expose(c *gin.Context)
MiddleWare(c *gin.Context)
CollectMetrics(c *gin.Context, start time.Time)
ExcludePath(startWith ...string)
GetMetric(name string) *metrics
SetMetric(metric Metrics) error
AddMetric(metric Metrics) error
ListMetric() []string
SetSlowTime(slowTime int32)
GetSlowTime() int32
SetDuration(duration []float64)
GetDuration() []float64
}
func New ¶
func New() Prometheus
New will return a new object that implement interface GinPrometheus.
Click to show internal directories.
Click to hide internal directories.