Good catch! This issue is caused by the relay reporting bandwidth statistics for 2019 and Onionoo not discarding excluding those from bandwidth docs until it's 2019.
I'd rather want us to fix this in Onionoo, not in Atlas and all other Onionoo clients.
Example descriptor 6/3/63ff123399bafc9b28d837ea0fa63f798c4a6a2a from this tarball:
With the analysis above I'd say that this ticket is a fine candidate for a new volunteer. Fixing this issue could start with writing a test that uses the descriptor above as input and produces a bandwidth document until 2019. The next step would be to fix the issue.
Trac: Component: Metrics/Atlas to Metrics/Onionoo Owner: irl to metrics-team Keywords: N/Adeleted, metrics-help added
I removed a checkstyle complaint from the test and changed it to use test data with a future date computed from the current time instead of having another dependency on Time and TimeFactory class. (Long ago we discussed that these are problematic and by reducing using them they might be obsolete at some point. Maybe, Time and TimeFactory should even be deprecated?)
Thanks for reviewing, and thanks for catching that checkstyle complaint!
However, there's a problem with the amended test: as time progresses, the four sample lines will be merged into a single data point in a "3_months" graph, and that graph won't be written anymore, because we require at least two consecutive data points in a graph. tl;dr: we'll have to calculate dates for the first four lines as well, ideally by picking yesterday or the day before. Should we do that and keep the Time dependency out, or should we just keep the test unchanged and only fix the checkstyle issue? I don't feel strongly.
Oh, one more thing to fix: status.setFromDocumentString(documentString); needs to stay, or the test won't succeed.
Avoiding and finally removing these Time-changer classes is important.
I amended my branch with the suggested changes, and added a deprecation commit on top that will remind about this in future.
Leaving this ticket open until we have put out the next release and deployed the new version on the server. Otherwise we'll wonder why the bug is still around when in fact it's already fixed in the undeployed code.