Download times in Torperf graphs have always been 1 second too high
We recently changed metrics-web to use the new Torperf data file format .tpf instead of Torperf's .data files. This seemed to work fine, but a side-effect of this change was that download times magically went down by about 1 second. This is most visible in the 50 KiB graphs.
I found the problem: download times in the graphs have always been 1 second too high! Here's the problematic old code that now got replaced:
- long completeMillis = Long.parseLong(parts[16])
- * 1000L + Long.parseLong(parts[17]) / 1000L
- - Long.parseLong(parts[0]) * 1000L
- + Long.parseLong(parts[1]) / 1000L;
parts[16]
and parts[17]
are the seconds and microseconds when a download was completed, and parts[0]
and parts[1]
was when the request was started. Note how there should be parentheses around the last two lines? Instead of subtracting the microseconds when the request was started, we added them. Assume that this number was 500,000 in the mean, so that the overall result was by 1,000,000 microseconds or 1 second too high in the mean. Oops.
This problem is already fixed in the code with the move to metrics-lib and the new .tpf format. The new numbers since early June 2012 are correct.
I'll have to re-do the existing Torperf statistics. This bug was present since we first added Torperf graphs to the metrics website in January 2010.