Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultSlowTime = int32(5)
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FuncCollectMetrics ¶ added in v1.10.0
type FuncGetPrometheus ¶ added in v1.10.0
type FuncGetPrometheus func() Prometheus
type MetricsCollection ¶ added in v1.10.0
type MetricsCollection interface { // GetMetric is used to retrieve the metric instance from prometheus instance. GetMetric(name string) libmet.Metric // AddMetric is used to register the metric instance into prometheus instance. AddMetric(isAPI bool, metric libmet.Metric) error // DelMetric is used to unregister the metric instance into prometheus instance. DelMetric(name string) // ListMetric retrieve a slice of ginMet' name registered for all type API or not. ListMetric() []string }
type Prometheus ¶
type Prometheus interface { GinRoute MetricsCollection Collect SetSlowTime(slowTime int32) GetSlowTime() int32 SetDuration(duration []float64) GetDuration() []float64 }
func New ¶
func New(ctx libctx.FuncContext) Prometheus
New will return a new object that implement interface GinPrometheus.
Click to show internal directories.
Click to hide internal directories.