Skip to content

feat(agent): Add leeching throughput metric#604

Merged
Anton-Kalpakchiev merged 3 commits into
masterfrom
add-leeching-throughput-metric
Apr 22, 2026
Merged

feat(agent): Add leeching throughput metric#604
Anton-Kalpakchiev merged 3 commits into
masterfrom
add-leeching-throughput-metric

Conversation

@Anton-Kalpakchiev
Copy link
Copy Markdown
Collaborator

@Anton-Kalpakchiev Anton-Kalpakchiev commented Apr 22, 2026

Replace agent's time_per_mb latency metric with a p2p_leech_throughput metric in MiB/s.

Benefits:

  • we now emit metrics on <1MB blobs - this includes a SIGNIFICANT chunk of kraken download blob requests, as every image has 1-3 image manifests, which are <1MB.
  • we use a histogram instead of a timer (lower cardinality)
  • all throughput metrics are now centralized under lib/observability
  • we now tag blobs by size when emitting the leeching throughput
  • I also added a few more throughput buckets, in case throughput is very high (also since I'll be reusing this function for the origin downloads from GCS)
  • Finally, I added a safeguard in the EmitDownloadPerformance function against a user providing latency=0, which would result in a panic when emitting the mbPerSec (some unit tests use clock.NewMock and unfortunately can't increment the clock in the middle of a download).

@Anton-Kalpakchiev Anton-Kalpakchiev merged commit db728c9 into master Apr 22, 2026
10 checks passed
@Anton-Kalpakchiev Anton-Kalpakchiev deleted the add-leeching-throughput-metric branch April 22, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants