use even less pointers

This commit is contained in:
oliverpool 2017-02-28 11:57:56 +01:00
parent db7130f18a
commit 13bc64517b
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ var MetricsOpenConnections = prometheus.NewGauge(prometheus.GaugeOpts{
func SetupMetrics(handler *tusd.Handler) {
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)
http.Handle(Flags.MetricsPath, prometheus.Handler())

View File

@ -46,11 +46,11 @@ var (
)
type Collector struct {
metrics *tusd.Metrics
metrics tusd.Metrics
}
// 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{
metrics: metrics,
}