[jboss-jira] [JBoss JIRA] (WFLY-11718) MicroProfileMetricsHistogramMultipleInvocationsTestCase fails intermittently

Chao Wang (Jira) issues at jboss.org
Wed Feb 20 04:42:00 EST 2019


    [ https://issues.jboss.org/browse/WFLY-11718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13697988#comment-13697988 ] 

Chao Wang commented on WFLY-11718:
----------------------------------

This can be produced 100% in slow invocation (break point or time waiting among invocations).
I think this happens due to the smallrye-metrics [ExponentiallyDecayingReservoir|https://github.com/smallrye/smallrye-metrics/blob/1.1.3/implementation/src/main/java/io/smallrye/metrics/app/ExponentiallyDecayingReservoir.java#L70-L73] implementation as explained

{code:java}
    /**
     * Creates a new {@link ExponentiallyDecayingReservoir} of 1028 elements, which offers a 99.9%
     * confidence level with a 5% margin of error assuming a normal distribution, and an alpha
     * factor of 0.015, which heavily biases the reservoir to the past 5 minutes of measurements.
     */
{code}

which updates item weight based on time calculation

{code:java}
final double itemWeight = weight(timestamp - startTime);
{code}

So this will eventually affect weighted arithmetic mean result.

[ExportersMetricScalingTest.histogram_json|https://github.com/smallrye/smallrye-metrics/blob/1.1.3/implementation/src/test/java/io/smallrye/metrics/exporters/ExportersMetricScalingTest.java#L141-L144] calls assertEquals with a delta value at the end as:

{code:java}
assertEquals(120.0, json.getJsonNumber("mean").doubleValue(), 0.001);
{code}

Last two teamcity failures are:

{noformat}
java.lang.AssertionError: Expected value of 'mean' is 3.0, but was 3.0089998312537976.
java.lang.AssertionError: Expected value of 'mean' is 3.0, but was 3.007477427516212.
{noformat}

[~jmesnil] Can we add an acceptable delta as well for this?

> MicroProfileMetricsHistogramMultipleInvocationsTestCase fails intermittently
> ----------------------------------------------------------------------------
>
>                 Key: WFLY-11718
>                 URL: https://issues.jboss.org/browse/WFLY-11718
>             Project: WildFly
>          Issue Type: Bug
>          Components: MP Metrics
>    Affects Versions: 16.0.0.Beta1
>            Reporter: Jeff Mesnil
>            Assignee: Jeff Mesnil
>            Priority: Major
>
> Test org.wildfly.test.integration.microprofile.metrics.metadata.MicroProfileMetricsHistogramMultipleInvocationsTestCase.testMultipleInvocationsOfEndpoint is failing intermittently.
> @Ignore-it until it is fix to consistently pass.



--
This message was sent by Atlassian Jira
(v7.12.1#712002)


More information about the jboss-jira mailing list