-
Notifications
You must be signed in to change notification settings - Fork 992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(config): Make the packet timeline configurable. #2163
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fcea8cf
feat(config): Make the packet timeline configurable.
bgrozev eaed5db
feat(config): Also configure how often to log.
bgrozev 2a995d4
ref: Make PacketInfo.timeline nullable.
bgrozev 93f2360
fix: Make the packet timeline thread safe.
bgrozev 309e280
feat(stats): Count iceTransport.send as part of transit time.
bgrozev 826545c
squash: Avoid using ConcurrentLinkedQueue.
bgrozev b56b14f
squash: Also aply stats re-order to Relay.
bgrozev 28251c4
squash: Remove unnecessary type, inherit the clock in clone().
bgrozev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ import java.time.Clock | |
import java.time.Duration | ||
import java.time.Instant | ||
import java.util.Collections | ||
import java.util.concurrent.ConcurrentLinkedQueue | ||
|
||
@SuppressFBWarnings("CN_IMPLEMENTS_CLONE_BUT_NOT_CLONEABLE") | ||
class EventTimeline( | ||
|
@@ -34,9 +33,12 @@ class EventTimeline( | |
* by a different thread. This is not critical as it only affects the timeline and the result is just some "exit" | ||
* events missing from the trace logs. | ||
*/ | ||
private val timeline: ConcurrentLinkedQueue<Pair<String, Duration>> = ConcurrentLinkedQueue(), | ||
timelineArg: MutableList<Pair<String, Duration>> = mutableListOf(), | ||
private val clock: Clock = Clock.systemUTC() | ||
) : Iterable<Pair<String, Duration>> { | ||
|
||
private val timeline: MutableList<Pair<String, Duration>> = Collections.synchronizedList(timelineArg) | ||
|
||
/** | ||
* The [referenceTime] refers to the first timestamp we have | ||
* in the timeline. In the timeline this is used as time "0" and | ||
|
@@ -56,7 +58,7 @@ class EventTimeline( | |
} | ||
|
||
fun clone(): EventTimeline { | ||
val clone = EventTimeline(ConcurrentLinkedQueue(timeline)) | ||
val clone = EventTimeline(timeline.toMutableList()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a new bug, but while you're in there, |
||
clone.referenceTime = referenceTime | ||
return clone | ||
} | ||
|
@@ -77,7 +79,9 @@ class EventTimeline( | |
return with(StringBuffer()) { | ||
referenceTime?.let { | ||
append("Reference time: $referenceTime; ") | ||
append(timeline.joinToString(separator = "; ")) | ||
synchronized(timeline) { | ||
append(timeline.joinToString(separator = "; ")) | ||
} | ||
} ?: run { | ||
append("[No timeline]") | ||
} | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't need the type