google / stenographer

Stenographer is a packet capture solution which aims to quickly spool all packets to disk, then provide simple, fast access to subsets of those packets. Discussion/announcements at stenographer@googlegroups.com
Apache License 2.0
1.79k stars 238 forks source link

fix bugs related to introduction of flag --blocksize_kb #213

Closed emillynge closed 5 years ago

emillynge commented 5 years ago

Dear maintainers

Please accept this PR which fixes a couple of issues that has arisen due to the introduction of --blocksize_kb option.

In general these issue stem from the previous assumption that a block is 1MB.

The stats MBps and MB are wrong when bz!=1MB Files are not rotated at the right time. Specifically, bz>1MB can lead to a PKT file larger than 4Gb which causes a fatal error. To fix the issue, i've introduced a new variable blocks_per_file which is determined by the values flag_filesize_mband flag_blocksize_kb.

I'm not entirely sure whether the pattern of calculating blocks_per_file in the switch block is the right way to go.

NB: closed previous PR in order to create PR from company repo instead

googlebot commented 5 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

emillynge commented 5 years ago

@googlebot I signed it!

wehowsky-admin commented 5 years ago

@googlebot I signed it!

emillynge commented 5 years ago

@googlebot I signed it!

emillynge commented 5 years ago

@googlebot I signed it!

googlebot commented 5 years ago

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

gconnell commented 5 years ago

Thanks, and sorry for the late reply!