-
Notifications
You must be signed in to change notification settings - Fork 867
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
Conversation
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); |
There was a problem hiding this comment.
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?
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, indeed, thx!
No description provided.