use even less pointers
This commit is contained in:
parent
db7130f18a
commit
13bc64517b
|
@ -16,7 +16,7 @@ var MetricsOpenConnections = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||||
|
|
||||||
func SetupMetrics(handler *tusd.Handler) {
|
func SetupMetrics(handler *tusd.Handler) {
|
||||||
prometheus.MustRegister(MetricsOpenConnections)
|
prometheus.MustRegister(MetricsOpenConnections)
|
||||||
prometheus.MustRegister(prometheuscollector.New(&handler.Metrics))
|
prometheus.MustRegister(prometheuscollector.New(handler.Metrics))
|
||||||
|
|
||||||
stdout.Printf("Using %s as the metrics path.\n", Flags.MetricsPath)
|
stdout.Printf("Using %s as the metrics path.\n", Flags.MetricsPath)
|
||||||
http.Handle(Flags.MetricsPath, prometheus.Handler())
|
http.Handle(Flags.MetricsPath, prometheus.Handler())
|
||||||
|
|
|
@ -46,11 +46,11 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Collector struct {
|
type Collector struct {
|
||||||
metrics *tusd.Metrics
|
metrics tusd.Metrics
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new collector which read froms the provided Metrics struct.
|
// New creates a new collector which read froms the provided Metrics struct.
|
||||||
func New(metrics *tusd.Metrics) Collector {
|
func New(metrics tusd.Metrics) Collector {
|
||||||
return Collector{
|
return Collector{
|
||||||
metrics: metrics,
|
metrics: metrics,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue