Skip to content

Commit

Permalink
chore: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill committed Oct 23, 2023
1 parent 23f5976 commit eb17e67
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkg/check/longavailability/longavailability.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, o interf
continue
}
c.logger.Infof("download size %d", size)
c.metrics.DownloadSize.Set(float64(size))
c.metrics.DownloadSize.Add(float64(size))
dur := time.Since(start)
c.metrics.DownloadDuration.Observe(dur.Seconds())
c.metrics.DownloadDuration.Add(dur.Seconds())
c.logger.Infof("node %s: downloaded %s successfully in %v", node.Name(), addr, dur)
break
}
Expand Down
14 changes: 7 additions & 7 deletions pkg/check/longavailability/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
type metrics struct {
DownloadErrors prometheus.Counter
DownloadAttempts prometheus.Counter
DownloadDuration prometheus.Histogram
DownloadSize prometheus.Gauge
DownloadDuration prometheus.Counter
DownloadSize prometheus.Counter
}

func newMetrics(subsystem string) metrics {
Expand All @@ -28,19 +28,19 @@ func newMetrics(subsystem string) metrics {
Name: "download_errors_count",
Help: "The total number of errors encountered before successful download.",
}),
DownloadDuration: prometheus.NewHistogram(
prometheus.HistogramOpts{
DownloadDuration: prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: m.Namespace,
Subsystem: subsystem,
Name: "data_download_duration",
Help: "Data download duration through the /bytes endpoint.",
}),
DownloadSize: prometheus.NewGauge(
prometheus.GaugeOpts{
DownloadSize: prometheus.NewCounter(
prometheus.CounterOpts{
Namespace: m.Namespace,
Subsystem: subsystem,
Name: "download_size",
Help: "Amount of data downloaded per download.",
Help: "Amount of data downloaded.",
},
),
}
Expand Down

0 comments on commit eb17e67

Please sign in to comment.