Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RequestCount = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: namespace, Subsystem: "", Name: "requests_total", Help: "How many HTTP requests processed, partitioned by status code and HTTP method.", }, []string{"code", "method", "path"}) RequestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Namespace: namespace, Subsystem: "", Name: "request_duration_seconds", Help: "The HTTP request latencies in seconds.", }, []string{"code", "method", "path"}) )
Functions ¶
func CollectRequestMetrics ¶
func CollectRequestMetrics() gin.HandlerFunc
CollectRequestMetrics is the middleware to collect metrics for the request.
Types ¶
type Interactor ¶
type Interactor interface {
CountActiveRepos(ctx context.Context) (int, error)
CountRepos(ctx context.Context) (int, error)
ListAllDeploymentStatistics(ctx context.Context) ([]*ent.DeploymentStatistics, error)
ListDeploymentStatisticsGreaterThanTime(ctx context.Context, updated time.Time) ([]*ent.DeploymentStatistics, error)
GetLicense(ctx context.Context) (*extent.License, error)
}
type Metric ¶
type Metric struct {
// contains filtered or unexported fields
}
func NewMetric ¶
func NewMetric(c *MetricConfig) *Metric
func (*Metric) CollectMetrics ¶
type MetricConfig ¶
type MetricConfig struct {
Interactor
PrometheusAuthSecret string
}
Click to show internal directories.
Click to hide internal directories.