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

Get progress of readMessages #66

Open
khvr000 opened this issue Mar 12, 2020 · 2 comments
Open

Get progress of readMessages #66

khvr000 opened this issue Mar 12, 2020 · 2 comments

Comments

@khvr000
Copy link

khvr000 commented Mar 12, 2020

I want to show the progress of reading the file, something like progress bar.How to get the progress of how much of file has been parsed/read.

Please provide info If I have overlooked already existing properties.

@jtbandes
Copy link
Contributor

The ReadResult contains progress info at the level of chunks:

  // the offset of the chunk being read
  // starts at 0 and eventually increments to totalChunks
  // useful for computing read progress as a percentage
  chunkOffset: number,

  // the total chunks to eventually be consumed
  // during the current read operation
  totalChunks: number,

@janpaul123
Copy link
Contributor

If you're just reading the entire bag, you can determine how many messages there are in each topic by using bag.chunkInfos. Each ChunkInfo has a list of "connections" and how many messages there are for that connection. You can map back connections to topic names using bag.connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants