Skip to content

Support core metrics for async non-streaming and streaming operations #1889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2020

Conversation

zoewangg
Copy link
Contributor

@zoewangg zoewangg commented Jun 11, 2020

Description

Support core metrics for async non-streaming and streaming operations

This might or might not be the last part depending on my findings in even streaming signing

Eventstreaming core metrics support will be in another PR

License

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

@zoewangg zoewangg force-pushed the zoewang/asyncMetrics2 branch 2 times, most recently from 9b29c03 to 661077a Compare June 11, 2020 18:23
@zoewangg zoewangg force-pushed the zoewang/asyncMetrics2 branch 2 times, most recently from 04ea3a0 to a26d4aa Compare June 11, 2020 19:54
@zoewangg zoewangg changed the title Support core metrics for async clients Support core metrics for async non-streaming and streaimging operations Jun 11, 2020
@zoewangg zoewangg changed the title Support core metrics for async non-streaming and streaimging operations Support core metrics for async non-streaming and streaming operations Jun 11, 2020
@zoewangg zoewangg force-pushed the zoewang/asyncMetrics2 branch from a26d4aa to bfbea76 Compare June 11, 2020 21:24
@zoewangg zoewangg force-pushed the zoewang/asyncMetrics2 branch from bfbea76 to df636f1 Compare June 11, 2020 23:50
.metricPublisher(new MetricPublisher() {
@Override
public void publish(MetricCollection metricCollection) {
System.out.println(metricCollection);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove print

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in #1895

Comment on lines +184 to +188
httpClientFuture.whenCompleteAsync((r, t) -> {
long duration = System.nanoTime() - callStart;
metricCollector.reportMetric(CoreMetric.HTTP_REQUEST_ROUND_TRIP_TIME, Duration.ofNanos(duration));
}, futureCompletionExecutor);
return httpClientFuture;
Copy link
Contributor

Choose a reason for hiding this comment

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

does this account for errors that result in no HTTP request being sent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems there's no way to tell if the cause of the error is http request not being sent or http response not being received. I can update it to not report HTTP_REQUEST_ROUND_TRIP_TIME if there's an error, WDUT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think that's more reasonable. Having this metric in there if the request didn't get fully sent or we didn't receive a response might be misleading.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 6 Code Smells

82.0% 82.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it from October 2020. Please update to at least Java 11.
Read more here

@zoewangg zoewangg merged commit 1f53f9c into sdk-metrics-development-2 Jun 12, 2020
@zoewangg zoewangg deleted the zoewang/asyncMetrics2 branch August 19, 2020 22:46
aws-sdk-java-automation added a commit that referenced this pull request Jan 10, 2022
…97b8497d6

Pull request: release <- staging/b8382d15-ae8a-46fe-808a-c0897b8497d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants