Skip to content
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 progress bar for mcap convert #973

Merged
merged 6 commits into from
Sep 20, 2023

Conversation

narasaka
Copy link
Contributor

Public-Facing Changes

This adds a progress bar when running mcap convert ...

@@ -225,7 +232,7 @@ func channelIDForConnection(connID uint32) (uint16, error) {
return uint16(connID), nil
}

func Bag2MCAP(w io.Writer, r io.Reader, opts *mcap.WriterOptions) error {
func Bag2MCAP(w io.Writer, r io.Reader, opts *mcap.WriterOptions, progressBar *progressbar.ProgressBar) error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I feel like i should just put the progress bar in this function instead of injecting it 🤷

Copy link
Contributor

Choose a reason for hiding this comment

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

that does seem nicer, but you'd just need to pass in a messageCount.

Maybe the cleanest option would be to pass in the *Info struct, and then construct the progress bar in here? You need to call Info() outside this function (as you do) or else you would need to pass this a ReadSeeker, which you're not in position to do.

@wkalt
Copy link
Contributor

wkalt commented Sep 18, 2023

This looks great generally. The thing that's not clear to me is this:

 100% |████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (1606/1606, 4395 it/s)

the 1606 needs some units, and I have no idea what "it/s" is. I guess that's the conversion rate? We can probably either remove that, or change it to a MB/sec computation.

go/ros/ros2db3_to_mcap.go Outdated Show resolved Hide resolved
@@ -173,6 +173,10 @@ func processBag(
}
}

if err != nil {
return err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove


if err != nil {
return fmt.Errorf("failed to increment progress bar: %w", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

remove

go/go.work Outdated
@@ -1,4 +1,6 @@
go 1.18
go 1.21
Copy link
Contributor

Choose a reason for hiding this comment

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

1.18

This adds a progressbar to the `convert` command to show percentage
completion of converting from both ros and db3 to mcap.
@narasaka narasaka force-pushed the nathan/fg-4674-progress-bar-for-mcap-convert branch from f985b99 to 5fcd91f Compare September 20, 2023 21:18
@narasaka narasaka merged commit 91b3a9f into main Sep 20, 2023
24 checks passed
@narasaka narasaka deleted the nathan/fg-4674-progress-bar-for-mcap-convert branch September 20, 2023 21:57
pezy pushed a commit to pezy/mcap that referenced this pull request Jan 11, 2024
### Public-Facing Changes

This adds a progress bar to show percentage completion when running `mcap convert ...`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants