Skip to content

Commit

Permalink
Fixes TestMetrics filter bug.
Browse files Browse the repository at this point in the history
Previously, this matches implementation was ignoring the `name` passed
in and instead comparing the *literal* `"testMetricWait.pool.Wait"` to
the dynamically-created
`MetricRegistry.name("testMetricWait", "pool", "Wait")`.

This commit updates the matches implementation to instead compare the
`name` passed in.

This brings it in line with the other implementations in the same file.
  • Loading branch information
pennello committed Jun 28, 2023
1 parent a7d9136 commit 07e40c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/java/com/zaxxer/hikari/pool/TestMetrics.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void testMetricWait() throws SQLException
@Override
public boolean matches(String name, Metric metric)
{
return "testMetricWait.pool.Wait".equals(MetricRegistry.name("testMetricWait", "pool", "Wait"));
return name.equals(MetricRegistry.name("testMetricWait", "pool", "Wait"));
}
}).values().iterator().next();

Expand Down

0 comments on commit 07e40c2

Please sign in to comment.