Skip to content

Conversation

@zoewangg
Copy link
Contributor

@zoewangg zoewangg commented Feb 2, 2026

Motivation and Context

This PR adds a WRITE_THROUGHPUT metric to measure request body upload speed (bytes/sec), complementing the existing READ_THROUGHPUT metric. The implementation tracks timing from when the first byte is read from the request body stream to when the last byte is read. Fixes #3704

The changes have been reviewed and approved in #6688 and #6698 except the ones from the last commit.

Modifications

  • Added WRITE_THROUGHPUT metric to CoreMetric class
  • Implemented BytesWrittenTrackingInputStream for sync clients to track bytes read from request body stream
  • Implemented BytesWrittenTrackingPublisher for async clients with TCK compliance
  • Added RequestBodyMetrics container class to hold timing and byte count data
  • Integrated tracking into MakeHttpRequestStage (sync) and MakeAsyncHttpRequestStage (async)
  • Report metric in HandleResponseStage (sync) and AsyncApiCallAttemptMetricCollectionStage (async)
  • Added design documentation in docs/design/core/metrics/writeThroughput/

Testing

  • Unit tests for BytesWrittenTrackingInputStream and BytesWrittenTrackingPublisher
  • TCK verification test for BytesWrittenTrackingPublisher
  • Functional tests for sync and async clients (SyncWriteThroughputMetricTest, AsyncWriteThroughputMetricTest)
  • Integration tests in PutObjectIntegrationTest for S3 sync and async clients

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created
    by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@zoewangg zoewangg requested a review from a team as a code owner February 2, 2026 19:06
@zoewangg zoewangg added the api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team label Feb 5, 2026
@zoewangg zoewangg enabled auto-merge February 6, 2026 17:45
@zoewangg zoewangg added this pull request to the merge queue Feb 6, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Feb 6, 2026
@zoewangg zoewangg enabled auto-merge February 11, 2026 18:37
@sonarqubecloud
Copy link

@zoewangg zoewangg added this pull request to the merge queue Feb 11, 2026
Merged via the queue into master with commit efb9951 Feb 12, 2026
39 of 40 checks passed
@github-actions
Copy link

This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api-surface-area-approved-by-team Indicate API surface area introduced by this PR has been approved by team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add throughput metrics to request metrics

2 participants