Skip to content

Commit

Permalink
Merge branch '3.0.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed May 5, 2023
2 parents 25ad24c + be29ab3 commit 66cc9d7
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,33 +175,33 @@ void configureWhenAllHistogramTrueSetPercentilesHistogramToTrue() {
@Test
void configureWhenHasPercentilesShouldSetPercentilesToValue() {
PropertiesMeterFilter filter = new PropertiesMeterFilter(
createProperties("distribution.percentiles.spring.boot=1,1.5,2"));
createProperties("distribution.percentiles.spring.boot=0.2,0.4,0.8"));
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT).getPercentiles())
.containsExactly(1, 1.5, 2);
.containsExactly(0.2, 0.4, 0.8);
}

@Test
void configureWhenHasHigherPercentilesShouldSetPercentilesToValue() {
PropertiesMeterFilter filter = new PropertiesMeterFilter(
createProperties("distribution.percentiles.spring=1,1.5,2"));
createProperties("distribution.percentiles.spring=0.2,0.4,0.8"));
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT).getPercentiles())
.containsExactly(1, 1.5, 2);
.containsExactly(0.2, 0.4, 0.8);
}

@Test
void configureWhenHasHigherPercentilesAndLowerShouldSetPercentilesToLower() {
PropertiesMeterFilter filter = new PropertiesMeterFilter(createProperties(
"distribution.percentiles.spring=1,1.5,2", "distribution.percentiles.spring.boot=3,3.5,4"));
"distribution.percentiles.spring=0.2,0.4,0.8", "distribution.percentiles.spring.boot=0.85,0.9,0.95"));
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT).getPercentiles())
.containsExactly(3, 3.5, 4);
.containsExactly(0.85, 0.9, 0.95);
}

@Test
void configureWhenAllPercentilesSetShouldSetPercentilesToValue() {
PropertiesMeterFilter filter = new PropertiesMeterFilter(
createProperties("distribution.percentiles.all=1,1.5,2"));
createProperties("distribution.percentiles.all=0.2,0.4,0.8"));
assertThat(filter.configure(createMeterId("spring.boot"), DistributionStatisticConfig.DEFAULT).getPercentiles())
.containsExactly(1, 1.5, 2);
.containsExactly(0.2, 0.4, 0.8);
}

@Test
Expand Down

0 comments on commit 66cc9d7

Please sign in to comment.