Skip to content
Snippets Groups Projects
Commit d18af7e6 authored by Malte Bauch's avatar Malte Bauch
Browse files

linting

parent 1c4414fa
Branches
No related tags found
1 merge request!221Thesis mk
Pipeline #88945 passed
...@@ -59,5 +59,4 @@ func TestUseExistingConfig(t *testing.T) { ...@@ -59,5 +59,4 @@ func TestUseExistingConfig(t *testing.T) {
logrus.InfoLevel, LogLevel) logrus.InfoLevel, LogLevel)
} }
} }
} }
...@@ -6,17 +6,23 @@ import ( ...@@ -6,17 +6,23 @@ import (
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
) )
// nolint
// TODO: add description
func StartHook(labels prometheus.Labels, counter *prometheus.CounterVec) time.Time { func StartHook(labels prometheus.Labels, counter *prometheus.CounterVec) time.Time {
counter.With(labels).Inc() counter.With(labels).Inc()
return time.Now() return time.Now()
} }
// nolint
// TODO: add description
func FinishHook(labels prometheus.Labels, start time.Time, counter *prometheus.CounterVec, hist *prometheus.HistogramVec) { func FinishHook(labels prometheus.Labels, start time.Time, counter *prometheus.CounterVec, hist *prometheus.HistogramVec) {
duration := time.Since(start) duration := time.Since(start)
counter.With(labels).Add(duration.Seconds()) counter.With(labels).Add(duration.Seconds())
hist.With(labels).Observe(duration.Seconds()) hist.With(labels).Observe(duration.Seconds())
} }
// nolint
// TODO: add description
func HandleError(labels prometheus.Labels, err error, counter *prometheus.CounterVec) error { func HandleError(labels prometheus.Labels, err error, counter *prometheus.CounterVec) error {
errLabels := make(prometheus.Labels) errLabels := make(prometheus.Labels)
for k, v := range labels { for k, v := range labels {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment