Skip to content

Add count#65

Merged
Tom-Willemsen merged 6 commits intomainfrom
bluesky_52
Apr 17, 2026
Merged

Add count#65
Tom-Willemsen merged 6 commits intomainfrom
bluesky_52

Conversation

@danielmaclaren
Copy link
Copy Markdown
Contributor

Jack and I's 'Count' function for data streaming rate

danielmaclaren and others added 2 commits April 7, 2026 16:13
Co-authored-by: Jack Harper <rerpha@users.noreply.github.com>
@rerpha rerpha changed the title Bluesky 52 Add count Apr 7, 2026
@rerpha rerpha requested a review from Tom-Willemsen April 7, 2026 15:24
Copy link
Copy Markdown
Member

@Tom-Willemsen Tom-Willemsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't functionally reviewed yet but looks like it should work.

A few nit-pick comments...

Comment thread src/count.rs Outdated
let mut bytes_this_second: usize = 0;
let mut total_bytes: usize = 0;
let mut stream = consumer.stream();
let mut interval = time::interval(Duration::from_secs(1));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense for this to be configurable (i.e. passed in through command-line flags)

Comment thread src/count.rs Outdated
Comment thread src/count.rs Outdated
Comment thread src/count.rs
Comment thread src/count.rs Outdated
@rerpha rerpha requested a review from Tom-Willemsen April 15, 2026 12:59
Comment thread src/count.rs Outdated
}
_ = interval.tick() => {
println!("{:.5} Mbit/s (since program start: average {:.5} Mbit/s, {:.5} MB total)",
bytes_this_second as f64/125000.0,
Copy link
Copy Markdown
Member

@Tom-Willemsen Tom-Willemsen Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only true if interval is 1.

Streaming at ~190 mbit/s with --interval 5:

985.75168 Mbit/s (since program start: average 189.82563 Mbit/s, 9609.95335 MB total)

bytes_this_second needs dividing by interval to be correct here

@Tom-Willemsen Tom-Willemsen merged commit b243c75 into main Apr 17, 2026
3 checks passed
@Tom-Willemsen Tom-Willemsen deleted the bluesky_52 branch April 17, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants