-
Notifications
You must be signed in to change notification settings - Fork 14
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
karabo-bridge-serve-run command #458
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a0f059c
Split out serve_data function and show moree info while streaming
takluyver e97f0cb
Fix getting length of deque
takluyver 2d4f64d
Print final update when streaming finishes
takluyver eae9935
Add karabo-bridge-serve-run command
takluyver 0e3d0df
karabo-bridge-serve-run: only send complete trains by default
takluyver a67217f
Fix parameters to serve_data()
takluyver cda0b9c
Ensure print_update() can't have an undefined variable
takluyver 73208fc
Make --port an option
takluyver 10f145a
Document karabo-bridge-serve-run command
takluyver 4554836
Add a test for karabo-bridge-serve-run
takluyver 505aa3b
Simplify test
takluyver a46793d
Recreate raw+proc folder tree for each test using it
takluyver f15401c
Give test subprocesses a chance to exit cleanly
takluyver 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
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.
I understand this is a rolling average, and limited to 10 elements, the length is 10 at max. (10 trains corresp. to 1 second), correct? Then:
sent_times[0]
is not the first time ever, but the first of the current deque (oldest elements are thrown out), sosent_times[-1]
minus 10 elements, correct?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.
Technically, why is it
len(deque)
and notlen(sent_times)
- do you actually access the overall length of a deque type (not the actual object which has the name "sent_times")?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.
Yup, 10 trains correspond to one second, and with a limit on the deque, each call to
.append()
drops one item out of the beginning (once it has filled up).Each timestamp is measured just after sending a train, and we calculate this before adding the new timestamp. So since
sent_times[0]
we have sent 9 more trains corresponding to the other 9 entries insent_times
, plus the one we've just sent but not yet added. So 10 trains in the measured time interval.