-
Notifications
You must be signed in to change notification settings - Fork 47
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
Add replay script #674
Add replay script #674
Conversation
How are Kafka and ZMQ used here? |
Could |
You probably want to lift the time sorting logic than merges documents from multiple collections into a time ordered stream in databroker and write a function like def merge_runs(*runs):
for name, doc in sort_and_collate(runs):
yield name, doc |
There is this function here that does something like that: Line 436 in 970e914
Which reminds me, that we may need to interlace the event/datum_pages for a single run if we want them to be in the right order. But if the generator is canonical() then that should already be done. |
The CLI portion of this (in
I see a way to do this that is simpler and also more realistic: a separate process per beamline, each running
This now happens here. It turns out it's a lot simpler to do this at the single-document level --- straight from Mongo before anythign could have been grouped into pages. databroker/databroker/mongo_normalized.py Lines 327 to 381 in c1f67cf
Replay can count on the documents coming out of databroker in strict time order. |
965c50f
to
04ae57e
Compare
Is this PR relevant to these items? |
Certainly relevant to bluesky/event-model#150 and bluesky/event-model#155. We may need to think about how something in event-model itself (or bluesky-live?) would be useful, in addition to this tool in databroker. Probably not? Needs though. |
Description
Adds a script that replays Bluesky runs with the correct timing.
Motivation and Context
This simulates live streaming data so we can develop and test code for streaming data without needing to be at a beamline looking at new data.
How Has This Been Tested?
This has been tested interactively while developing GUI applications.