#25397 closed defect (fixed)

Cut off lower number of expected clients at 0

Reported by: karsten Owned by: metrics-team
Priority: Medium Milestone:
Component: Metrics/Website Version:
Severity: Normal Keywords:
Cc: metrics-team Actual Points:
Parent ID: Points:
Reviewer: iwakeh Sponsor:

Description

We should avoid negative numbers in clients.csv and in per-graph CSV files based on it.

Take this graph as example:

https://metrics.torproject.org/userstats-relay-country.html?start=2013-08-15&end=2013-08-31&country=dk&events=on

The corresponding CSV file is:

date,users,downturns,upturns,lower,upper
2013-08-15,2419,FALSE,FALSE,1509,3400
2013-08-16,2417,FALSE,FALSE,1530,3526
2013-08-17,2583,FALSE,FALSE,1888,3593
2013-08-18,2625,FALSE,FALSE,2099,3451
2013-08-19,2631,FALSE,FALSE,1950,3865
2013-08-20,2998,FALSE,FALSE,-307,8058
2013-08-21,3429,FALSE,FALSE,-2158,12097
2013-08-22,4161,FALSE,FALSE,-5815,19493
2013-08-23,4910,FALSE,FALSE,-11092,29505
2013-08-24,5387,FALSE,FALSE,-14669,35722
2013-08-25,5899,FALSE,FALSE,-16103,38944
2013-08-26,6115,FALSE,FALSE,-18394,42370
2013-08-27,6486,FALSE,FALSE,-8958,29056
2013-08-28,7213,FALSE,FALSE,-4772,23752
2013-08-29,7950,FALSE,FALSE,-1111,19506
2013-08-30,8844,FALSE,FALSE,1660,17111
2013-08-31,9966,FALSE,FALSE,2088,19165

We can just cut the lower number at 0. Like in the graph.

We could do it in write_userstats_relay_country() or in the clients module. The first is at lot easier to fix.

Child Tickets

Change History (4)

comment:1 Changed 15 months ago by karsten

Status: newneeds_review

Please review commit ec26e2a in my task-25397 branch with a trivial fix. And while we're at it, please also review subsequent commit 9441c6b in the same branch which removes code that we don't use.

comment:2 Changed 14 months ago by karsten

Reviewer: iwakeh

Optimistically assigning to iwakeh's review queue.

comment:3 Changed 14 months ago by iwakeh

Status: needs_reviewmerge_ready

Looks fine and the second commit is very useful, too.

comment:4 Changed 14 months ago by karsten

Resolution: fixed
Status: merge_readyclosed

Thanks for checking! Merged and deployed. Closing.

Note: See TracTickets for help on using tickets.