[ 
https://issues.apache.org/jira/browse/FLINK-10990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16697517#comment-16697517
 ] 

ASF GitHub Bot commented on FLINK-10990:
----------------------------------------

zentol commented on a change in pull request #7165: 
[FLINK-10990][Metric]Pre-check timespan in meterview to avoid NAN
URL: https://github.com/apache/flink/pull/7165#discussion_r236019092
 
 

 ##########
 File path: 
flink-metrics/flink-metrics-core/src/test/java/org/apache/flink/metrics/MeterViewTest.java
 ##########
 @@ -94,4 +95,12 @@ public void testGetRate() {
                assertEquals(0.0, m.getRate(), 0.1); // 480 - 480 / 60
 
        }
+
+       @Test
+       public void testTooSmallTimeSpan() {
+               MeterView m = new MeterView(1);
+               m.markEvent();
+               m.update();
+               assertTrue(0.2 == m.getRate());
 
 Review comment:
   use assertequals instead

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Pre-check timespan in meterview to avoid NAN
> --------------------------------------------
>
>                 Key: FLINK-10990
>                 URL: https://issues.apache.org/jira/browse/FLINK-10990
>             Project: Flink
>          Issue Type: Bug
>          Components: Metrics
>    Affects Versions: 1.7.0
>            Reporter: aitozi
>            Assignee: aitozi
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.7.0
>
>
> In the metric tool MeterView. If user use the meterview with the timespan 
> smaller than UPDATE_INTERVAL_SECONDS = 5 , the getRate will always return 0/0 
> = NAN. And this is not friendly , I think we should pre-check it.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to