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 07:56:00 GMT

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

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

I get:
{noformat}
testRFC5424Layout(org.apache.logging.log4j.flume.appender.FlumePersistentAppenderTest)  Time
elapsed: 30.762 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.494 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.155 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.138 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.27 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}

with Java 8 on Windows:
{noformat}
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T04:57:37-07:00)
Maven home: C:\Java\apache-maven-3.3.3
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_45\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"
{noformat}

> 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