From b8afde526a9b1c5950bdee992e60f9698fb22e01 Mon Sep 17 00:00:00 2001 From: istae <14264581+istae@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:19:17 +0300 Subject: [PATCH] chore: added metric for upload size --- pkg/check/smoke/metrics.go | 9 +++++++++ pkg/check/smoke/smoke.go | 2 ++ 2 files changed, 11 insertions(+) diff --git a/pkg/check/smoke/metrics.go b/pkg/check/smoke/metrics.go index f46cdb0ac..4759650ed 100644 --- a/pkg/check/smoke/metrics.go +++ b/pkg/check/smoke/metrics.go @@ -15,6 +15,7 @@ type metrics struct { DownloadAttempts prometheus.Counter UploadDuration prometheus.Histogram DownloadDuration prometheus.Histogram + UploadSize prometheus.Gauge } func newMetrics(subsystem string) metrics { @@ -91,6 +92,14 @@ func newMetrics(subsystem string) metrics { Help: "Data download duration through the /bytes endpoint.", }, ), + UploadSize: prometheus.NewGauge( + prometheus.GaugeOpts{ + Namespace: m.Namespace, + Subsystem: subsystem, + Name: "upload_size", + Help: "Amount of data uploaded per upload.", + }, + ), } } diff --git a/pkg/check/smoke/smoke.go b/pkg/check/smoke/smoke.go index c92d00aa0..ca6276300 100644 --- a/pkg/check/smoke/smoke.go +++ b/pkg/check/smoke/smoke.go @@ -91,6 +91,8 @@ func (c *Check) Run(ctx context.Context, cluster orchestration.Cluster, opts int test := &test{clients: clients, logger: c.logger} + c.metrics.UploadSize.Set(float64(o.ContentSize)) + for i := 0; true; i++ { select { case <-ctx.Done():