-
Notifications
You must be signed in to change notification settings - Fork 2
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
Trip Monitor analyzer improvement, status log #199
Conversation
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.
Good updates. Some minor comments, but approving.
// Performance note: Don't retrieve the full data for each trip at this time. | ||
// This saves bandwidth and memory, as we don't use the trip data immediately besides the ID. | ||
// The full data for each trip will be fetched at the time the actual analysis takes place. | ||
// TODO: Filter out trips that would be skipped by the CheckMonitoredTrip. |
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.
Can this TODO be done now? If not, perhaps explain why. TODOs seem to have a habit of not getting done.
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.
Yes, thank you, I added one criterion in ca89702 and reworded the TODO.
queueIterations++; | ||
// Report queue status every minute (unless this job finishes before). | ||
int runMillis = queueIterations * BLOCKING_QUEUE_DEPLETE_WAIT_TIME_MILLIS; | ||
if ((runMillis % 60000) == 0) { |
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.
Could create a constant for 60000 and use here and further down.
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.
Refactored in ca89702.
@@ -17,27 +17,27 @@ public class MonitoredTripLocks { | |||
/** the amount of time in milliseconds to wait to check if a lock has been released */ | |||
private static final int LOCK_CHECK_WAIT_MILLIS = 500; | |||
|
|||
private static final ConcurrentHashMap<MonitoredTrip, Boolean> locks = new ConcurrentHashMap(); | |||
private static final ConcurrentHashMap<String, Boolean> locks = new ConcurrentHashMap(); |
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.
SonarLint: Update to new ConcurrentHashMap<>()
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.
Refactored in ca89702.
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.
👍 Looks good.
Checklist
dev
before they can be merged tomaster
)Description
This PR improves the performance of the trip monitoring job (and reduces the risk of bugs from dropped Mongo connections) and adds logging to inform when trip analysis queues and states remain non-empty/non-idle for too long.