Skip to content

MINOR: Remove clients test-fixtures shadow JAR rewire hack#22699

Merged
chia7712 merged 7 commits into
apache:trunkfrom
m1a2st:minor-telemetry-tests-drop-otel
Jul 2, 2026
Merged

MINOR: Remove clients test-fixtures shadow JAR rewire hack#22699
chia7712 merged 7 commits into
apache:trunkfrom
m1a2st:minor-telemetry-tests-drop-otel

Conversation

@m1a2st

@m1a2st m1a2st commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

See the discussion:
#22201 (comment)

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions Bot added triage PRs from the community build Gradle build or GitHub Actions clients labels Jun 29, 2026
ByteBuffer compressedPayload;
try {
compressedPayload = ClientTelemetryUtils.compress(payload, compressionType);
compressedPayload = ClientTelemetryUtils.compress(ByteBuffer.wrap(payload.toByteArray()), compressionType);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid unnecessary memory copy here

@github-actions github-actions Bot removed the triage PRs from the community label Jun 30, 2026
ByteBuffer compressedPayload;
try {
compressedPayload = ClientTelemetryUtils.compress(payload, compressionType);
compressedPayload = ClientTelemetryUtils.compress(payload.toByteArray(), compressionType);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still makes an unnecessary deep copy. Memory prices have been freaking high lately

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, ClientTelemetryUtils.compress is exposed for mocking and throwing an expected exception. We can mock Compression#of instead, and it works perfectly since ClientTelemetryUtils.compress uses it internally to create a Compression object.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, addressed it!

return metricBuilder;
}

boolean hasSum() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add comments for those test-only methods?

*
* @return resource attributes keyed by label name, preserving insertion order.
*/
Map<String, String> resourceLabels() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method could be reused by updateLabels

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be synchronized?

@chia7712
chia7712 merged commit cac4d1f into apache:trunk Jul 2, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Gradle build or GitHub Actions clients

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants