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

Implement Oracle UCP connection pool metrics #6099

Merged
merged 3 commits into from
Jun 3, 2022

Conversation

laurit
Copy link
Contributor

@laurit laurit commented May 26, 2022

No description provided.

@laurit laurit requested a review from a team May 26, 2022 12:13
Comment on lines 82 to 92
testing()
.waitAndAssertMetrics(
INSTRUMENTATION_NAME, "db.client.connections.usage", AbstractIterableAssert::isEmpty);
testing()
.waitAndAssertMetrics(
INSTRUMENTATION_NAME, "db.client.connections.max", AbstractIterableAssert::isEmpty);
testing()
.waitAndAssertMetrics(
INSTRUMENTATION_NAME,
"db.client.connections.pending_requests",
AbstractIterableAssert::isEmpty);
Copy link
Member

Choose a reason for hiding this comment

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

same question from https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/6102/files#r883947307

is there a need for waiting here vs a single assert?

Comment on lines 82 to 92
testing()
.waitAndAssertMetrics(
INSTRUMENTATION_NAME, "db.client.connections.usage", AbstractIterableAssert::isEmpty);
testing()
.waitAndAssertMetrics(
INSTRUMENTATION_NAME, "db.client.connections.max", AbstractIterableAssert::isEmpty);
testing()
.waitAndAssertMetrics(
INSTRUMENTATION_NAME,
"db.client.connections.pending_requests",
AbstractIterableAssert::isEmpty);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
testing()
.waitAndAssertMetrics(
INSTRUMENTATION_NAME, "db.client.connections.usage", AbstractIterableAssert::isEmpty);
testing()
.waitAndAssertMetrics(
INSTRUMENTATION_NAME, "db.client.connections.max", AbstractIterableAssert::isEmpty);
testing()
.waitAndAssertMetrics(
INSTRUMENTATION_NAME,
"db.client.connections.pending_requests",
AbstractIterableAssert::isEmpty);
Set<String> metricNames =
new HashSet<>(
Arrays.asList(
"db.client.connections.usage",
"db.client.connections.max",
"db.client.connections.pending_requests"));
assertThat(testing().metrics())
.filteredOn(
metricData ->
metricData.getInstrumentationScopeInfo().getName().equals(INSTRUMENTATION_NAME)
&& metricNames.contains(metricData.getName()))
.isEmpty();

@trask is this what you meant?

Copy link
Member

Choose a reason for hiding this comment

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

ya, though maybe we also need to sleep (at least time for metric interval) before asserting

Copy link
Contributor

Choose a reason for hiding this comment

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

ya, though maybe we also need to sleep (at least time for metric interval) before asserting

Hmmm, do you think we're just getting lucky now then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a sleep right before the snippet starts and you are correct, it is needed.

Copy link
Member

Choose a reason for hiding this comment

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

oh, indeed, thx!

@trask trask merged commit 157ab7f into open-telemetry:main Jun 3, 2022
@laurit laurit deleted the oracle-ucp branch June 16, 2022 17:37
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