You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2015/06/13 22:54:00 UTC
[jira] [Comment Edited] (LOG4J2-982) Use System.nanoTime() to
measure time intervals
[ https://issues.apache.org/jira/browse/LOG4J2-982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14584812#comment-14584812 ]
Gary Gregory edited comment on LOG4J2-982 at 6/13/15 8:53 PM:
--------------------------------------------------------------
In git master now:
- Changes to log4j-core only.
- No changes to log4j-flume-ng.
I reviewed the log4j-core changes and I like the use of TimeUnit instead of the computations. The use of nanos seems justified based on the links posted in this ticket.
The changes to the log4j-flume-ng are not OK since some tests fail. I am attaching to this ticket a diff file for the log4j-flume-ng changes that I did not apply.
We could either:
- Close this ticket and rename it as a core only ticket and then open a new ticket for flume changes. Or,
- Keep it all in this ticket.
was (Author: garydgregory):
In git master now:
- Changes to log4j-core only.
- No changes to log4j-flume-ng.
I reviewed the log4j-core changes and I like the use of TimeUnit instead of the computations. The use of nanos seems justified based on the links posted in this ticket.
The changes to the log4j-flume-ng are not OK since some tests fail. I am attaching to this ticket a diff file for the log4j-flume-ng changes that I did not apply.
> 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, flume-nano.diff
>
>
> 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