Can’t upload the script, sorry. But it’s pretty simple. For each line of log:
- if it’s
upload started
ordownload started
, increment the counter for the number of current in-flight requests, - if it’s
uploaded
,downloaded
,upload cancelled
ordownload cancelled
, decrement the above counter. - if it’s
upload started
ordownload started
, memorize the satellite id, piece id and the current value of the above counter, - if it’s
uploaded
ordownloaded
, retrieve the memorized value of the counter for the given satellite id/piece id pair and memorize that there was a successful transfer at that number of in-flight requests. - if it’s
upload canceled
ordownload canceled
, retrieve the memorized value of the counter for the given satellite id/piece id pair and memorize that there was a canceled transfer at that number of in-flight requests.
Then print out the rates, noting to avoid computing rates if there aren’t enough samples (I picked a threshold of 100, which very roughly sets the error bars at ±10%).