logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-982) Use System.nanoTime() to measure time intervals
Date Sat, 13 Jun 2015 06:00:11 GMT

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

Gary Gregory commented on LOG4J2-982:
-------------------------------------

Thank you for the new patch.

When I run {{mvn clean install}} I get:

{noformat}
testRFC5424Layout(org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest)  Time
elapsed: 30.399 sec  <<< FAILURE!
java.lang.AssertionError: null
        at org.junit.Assert.fail(Assert.java:86)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertNotNull(Assert.java:621)
        at org.junit.Assert.assertNotNull(Assert.java:631)
        at org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest.testRFC5424Layout(FlumePersistentAppenderTest.java:287)

testMultiple(org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest)  Time elapsed:
30.212 sec  <<< FAILURE!
java.lang.AssertionError: Received 0 events. Event 1 is null
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertNotNull(Assert.java:621)
        at org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest.testMultiple(FlumePersistentAppenderTest.java:154)

testFailover(org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest)  Time elapsed:
30.141 sec  <<< FAILURE!
java.lang.AssertionError: Received 0 events. Event 1 is null
        at org.junit.Assert.fail(Assert.java:88)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertNotNull(Assert.java:621)
        at org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest.testFailover(FlumePersistentAppenderTest.java:182)

testLog4Event(org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest)  Time elapsed:
30.113 sec  <<< FAILURE!
java.lang.AssertionError: null
        at org.junit.Assert.fail(Assert.java:86)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertNotNull(Assert.java:621)
        at org.junit.Assert.assertNotNull(Assert.java:631)
        at org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest.testLog4Event(FlumePersistentAppenderTest.java:137)

testSingle(org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest)  Time elapsed:
30.117 sec  <<< FAILURE!
java.lang.AssertionError: null
        at org.junit.Assert.fail(Assert.java:86)
        at org.junit.Assert.assertTrue(Assert.java:41)
        at org.junit.Assert.assertNotNull(Assert.java:621)
        at org.junit.Assert.assertNotNull(Assert.java:631)
        at org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest.testSingle(FlumePersistentAppenderTest.java:232)


Results :

Failed tests:
  FlumePersistentAppenderTest.testFailover:182 Received 0 events. Event 1 is null
  FlumePersistentAppenderTest.testLog4Event:137 null
  FlumePersistentAppenderTest.testMultiple:154 Received 0 events. Event 1 is null
  FlumePersistentAppenderTest.testRFC5424Layout:287 null
  FlumePersistentAppenderTest.testSingle:232 null

Tests run: 19, Failures: 5, Errors: 0, Skipped: 0
{noformat}

If I then revert to a clean log4j-flume-ng module, the whole build succeeds.

What do you get?


> Use System.nanoTime() to measure time intervals
> -----------------------------------------------
>
>                 Key: LOG4J2-982
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-982
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: Core, Flume Appender
>            Reporter: Mikhail Mazurskiy
>            Priority: Minor
>         Attachments: LOG4J2-982-v2.patch, LOG4J2-982-v3.patch, LOG4J2-982-v4.patch, LOG4J2-982.patch
>
>
> Unlike {{System.currentTimeMillis()}}, which can jump/slew forward and backwards, {{System.nanoTime()}}
is a monotonic clock (at least it should be) and hence it should be used to measure time intervals
(timeouts/delays/etc).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message