-
Notifications
You must be signed in to change notification settings - Fork 22
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
Stream simulation results in their own thread #1630
Merged
Merged
+200
−159
Conversation
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
ae938e6
to
0db8fbb
Compare
Mythicaeda
reviewed
Feb 6, 2025
...ker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/postgres/PostgresProfileQueryHandler.java
Outdated
Show resolved
Hide resolved
Mythicaeda
reviewed
Feb 7, 2025
...-worker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/postgres/PostgresProfileStreamer.java
Outdated
Show resolved
Hide resolved
Mythicaeda
reviewed
Feb 11, 2025
...ker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/postgres/PostgresProfileQueryHandler.java
Outdated
Show resolved
Hide resolved
Mythicaeda
reviewed
Feb 11, 2025
...ker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/postgres/PostgresProfileQueryHandler.java
Outdated
Show resolved
Hide resolved
Mythicaeda
reviewed
Feb 11, 2025
...ker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/postgres/PostgresProfileQueryHandler.java
Outdated
Show resolved
Hide resolved
Mythicaeda
reviewed
Feb 11, 2025
...-worker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/postgres/PostgresProfileStreamer.java
Outdated
Show resolved
Hide resolved
Mythicaeda
reviewed
Feb 11, 2025
merlin-worker/src/main/java/gov/nasa/jpl/aerie/merlin/worker/postgres/PostgresQueryQueue.java
Outdated
Show resolved
Hide resolved
…e shared PostgresProfileQueryHandler
Mythicaeda
approved these changes
Feb 12, 2025
|
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
This should not be a breaking change.
This PR introduces threaded uploads of simulation results to the database. This is a follow up to this PR in which streaming simulation results were introduced.
Implementation Details
PostgresProfileQueryHandler
class which abstracts out database query logic that was previously inPostgresProfileStreamer
.PostgresProfileStreamer.accept()
calls will be in order.PostgresQueryQueue
which enqueues concurrent uploads using anExecutorService
.PostgresProfileStreamer
creates a single instance of the query queue, which handles all uploads and is automatically closed.Verification
Initially I had hoped to profile against the status prior to the original streaming PR but some version mismatches in clipper made this difficult.
I instead used the
feature--aerie-3.2.0
branch ofclipper-aerie
. I then extended Clipper'sgnc-all-activities
plan by repeating its content every day for five days. I'm happy to make this plan available to anyone who would like to see it or use it for future reference, but I doubt I can upload it here in this public venue. I ran profiling against this extendedgnc-all-activities
twice, once with high-overhead memory instrumentation and once with async sampling. I encountered errors when extracting mission model parameters, but this apparently did not impact simulation results, and the error message in the console was not helpful.Here are the results from using async sampling:
develop
feature/streaming-thread
Statistics for these results:
As expected, the primary gain here is in simulation duration, as we are no longer blocking simulation to upload results to the database. I'll attach some further sim results for anyone interested.
ProfilingResults.zip
Documentation
No documentation needs updating.
Future work