Skip to content

Commit

Permalink
chore: added metric for upload size
Browse files Browse the repository at this point in the history
  • Loading branch information
istae committed Oct 11, 2023
1 parent 40d37ca commit b8afde5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/check/smoke/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type metrics struct {
DownloadAttempts prometheus.Counter
UploadDuration prometheus.Histogram
DownloadDuration prometheus.Histogram
UploadSize prometheus.Gauge
}

func newMetrics(subsystem string) metrics {
Expand Down Expand Up @@ -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.",
},
),
}
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/check/smoke/smoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit b8afde5

Please sign in to comment.