prometheus

package
v1.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSlowTime = int32(5)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collect added in v1.10.0

type Collect interface {
	libmet.Collect
	CollectMetrics(ctx context.Context, name ...string)
}

type FuncCollectMetrics added in v1.10.0

type FuncCollectMetrics func(ctx context.Context, name ...string)

type FuncGetPrometheus added in v1.10.0

type FuncGetPrometheus func() Prometheus

type GinRoute added in v1.10.0

type GinRoute interface {
	Expose(ctx context.Context)
	ExposeGin(c *ginsdk.Context)

	MiddleWare(ctx context.Context)
	MiddleWareGin(c *ginsdk.Context)

	ExcludePath(startWith ...string)
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL