Skip to content

Mutiple metrics fixes #1930

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 30, 2020

Conversation

dagnir
Copy link
Contributor

@dagnir dagnir commented Jun 29, 2020

Description

  • Allow lists of publishers to be set.

    Allow setting of metric pubishers to be set on the client of request override
    rather than a single publisher, making using multiple MetricPublishers per
    client or request easier.

  • Remove any non-core usage of MetricUtils.

  • Fix metrics test in TranscribeStreamIntegrationTest.

Motivation and Context

Testing

Screenshots (if appropriate)

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 read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • 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

@dagnir dagnir force-pushed the remove-metricutils branch from 5343501 to 90dbadd Compare June 29, 2020 16:58
});
return executeFuture;
} catch (Throwable t) {
Optional<MetricPublisher> metricPublisher = MetricUtils.resolvePublisher(clientConfiguration,
List<MetricPublisher> metricPublisher = resolveMetricPublishers(clientConfiguration,
Copy link
Contributor

Choose a reason for hiding this comment

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

metricPublishers?

@@ -1070,6 +1061,21 @@ public void close() {
.exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build());
}

private static List<MetricPublisher> resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, why do we move this method out of MetricUtils?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed this with @millems. MetricUtils is @SdkInternal, and we'd rather keep it that way than expose it as a protected API.

client = clientWithPublishers(publisher1, publisher2);

try {
client.allTypes().join();
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: missing fail("no exception thrown"), same as other tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this necessary? It doesn't really matter if an exception is thrown or not; the test is just just checking that the right publishers are being used based on configuration. It just happens to throw here because the mock isn't fully set up

Copy link
Contributor

Choose a reason for hiding this comment

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

oh okay, I misread the test. We don't need it in this case

@dagnir dagnir force-pushed the remove-metricutils branch 3 times, most recently from f8875ae to d0ec398 Compare June 30, 2020 19:36
 - Allow lists of publishers to be set.

   Allow setting of metric pubishers to be set on the client of request override
   rather than a single publisher, making using multiple MetricPublishers per
   client or request easier.

 - Remove any non-core usage of MetricUtils.

 - Fix metrics test in TranscribeStreamIntegrationTest.

 - Fix Async API call metric stage to add the duration in a separate
   CompletionStage.
@dagnir dagnir force-pushed the remove-metricutils branch from d0ec398 to db2a251 Compare June 30, 2020 20:10
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.

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

91.1% 91.1% Coverage
9.8% 9.8% 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

@dagnir dagnir merged commit c4346d2 into aws:sdk-metrics-development-2 Jun 30, 2020
aws-sdk-java-automation added a commit that referenced this pull request Feb 10, 2022
…f6b14e58c

Pull request: release <- staging/992b5738-47e8-4c5c-a162-db9f6b14e58c
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.

2 participants