Use System.currentTimeMillis() instead of System.nanoTime() to measure wall clock duration#7865
Closed
mqliang wants to merge 1 commit intoapache:masterfrom
Closed
Use System.currentTimeMillis() instead of System.nanoTime() to measure wall clock duration#7865mqliang wants to merge 1 commit intoapache:masterfrom
mqliang wants to merge 1 commit intoapache:masterfrom
Conversation
…e wall clock duration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
OS have an in memory counter/clock which provides millisecond accuracy. For nanosecond accuracy OS have to
read a hardware counter. Communicating with hardware is much slower then reading some value already in memory,
this will cause some performance problem as we measure for each query, especially when QPS is high. Thus, use
System.currentTimeMillis()instead ofSystem.nanoTime()to measure wall clock duration. It will give usmillisecond resolution but that's fine, as most of queries takes > 1ms, if a query takes < 1ms, we can assume
systemActivitiesCpuTimeNs = 0.
Upgrade Notes
Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
backward-incompat, and complete the section below on Release Notes)Does this PR fix a zero-downtime upgrade introduced earlier?
backward-incompat, and complete the section below on Release Notes)Does this PR otherwise need attention when creating release notes? Things to consider:
release-notesand complete the section on Release Notes)Release Notes
Documentation