-
Notifications
You must be signed in to change notification settings - Fork 169
[jmx-scraper] wildfly refactor assertions #1587
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,9 @@ public MetricsVerifier disableStrictMode() { | |
| */ | ||
| @CanIgnoreReturnValue | ||
| public MetricsVerifier add(String metricName, Consumer<MetricAssert> assertion) { | ||
| if (assertions.containsKey(metricName)) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [for reviewer] this ensures that we don't have duplicated assertions for the same metric. |
||
| throw new IllegalArgumentException("Duplicate assertion for metric " + metricName); | ||
| } | ||
| assertions.put( | ||
| metricName, | ||
| metric -> { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,22 +59,24 @@ rules: | |
| - bean: jboss.as:subsystem=datasources,data-source=*,statistics=pool | ||
| metricAttribute: | ||
| data_source: param(data-source) | ||
| type: counter | ||
| prefix: wildfly.jdbc. | ||
| mapping: | ||
| ActiveCount: | ||
| metric: &metric connection.open | ||
| type: updowncounter | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [for reviewer] this was actually a mistake made when creating the yaml mapping. |
||
| unit: &unit "{connection}" | ||
| desc: &desc The number of open jdbc connections. | ||
| metricAttribute: | ||
| state: const(active) | ||
| IdleCount: | ||
| metric: *metric | ||
| type: updowncounter | ||
| unit: *unit | ||
| desc: *desc | ||
| metricAttribute: | ||
| state: const(idle) | ||
| WaitCount: | ||
| type: counter | ||
| metric: request.wait | ||
| unit: "{request}" | ||
| desc: The number of jdbc connections that had to wait before opening. | ||
|
|
||
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.
[for reviewer] duplicated test assertion for this metric.