Shouldn't this simply be:
`int64_t max_count = total_throughput;`

count is in bytes, not blocks.