Skip to content
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

Migrate "runtime-metrics" test from groovy to java #8928

Merged
merged 6 commits into from
Jul 18, 2023

Conversation

breedx-splk
Copy link
Contributor

Related to #7195

@breedx-splk breedx-splk requested a review from a team as a code owner July 11, 2023 21:07
@jeanbisutti
Copy link
Member

Great! It could help to test JVM metrics with a GraalVM native executable.

…aagent/src/test/java/io/opentelemetry/instrumentation/javaagent/runtimemetrics/java17/JmxRuntimeMetricsTest.java

Co-authored-by: Jean Bisutti <[email protected]>
@@ -76,6 +80,13 @@ public List<MetricData> metrics() {
return testRunner.getExportedMetrics();
}

/** Returns a list of metrics, filtered by instrumentation name */
public List<MetricData> instrumentationMetrics(String instrumentationName) {
Copy link
Member

Choose a reason for hiding this comment

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

We don't have analogous methods for any other signal; and it's only used in this class. WDYT about making it private?

Suggested change
public List<MetricData> instrumentationMetrics(String instrumentationName) {
private List<MetricData> instrumentationMetrics(String instrumentationName) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I intended it to be a public helper, analogous to metrics() but filtered to a specific instrumentation. It's only used internally now, but I could see it being useful elsewhere. If you think it's too much YAGNI then I will make it private.

Copy link
Member

Choose a reason for hiding this comment

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

Let's make it private -- there's just one use case for that now; and I think all 3 signals should have very similar API, so if we're introducing some new thing here we should do similar thing everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I relent. :) I think you have a higher standard for test code than I do.

Copy link
Member

Choose a reason for hiding this comment

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

Hah, I'm just thinking that YAGNI (probably) when it comes to making that method public

@mateuszrzeszutek mateuszrzeszutek merged commit 23acd5b into open-telemetry:main Jul 18, 2023
45 checks passed
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.

None yet

3 participants