[tor-bugs] #9889 [Atlas]: Add "Tshirt: yes/no" to Atlas and Globe
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Mar 20 07:03:05 UTC 2014
#9889: Add "Tshirt: yes/no" to Atlas and Globe
-----------------------------+----------------------------
Reporter: arma | Owner: hellais
Type: enhancement | Status: needs_revision
Priority: normal | Milestone:
Component: Atlas | Version:
Resolution: | Keywords:
Actual Points: | Parent ID:
Points: |
-----------------------------+----------------------------
Comment (by karsten):
Hi Sreenatha! Looks good! A few more comments below:
- I pushed your changes to the metrics-tasks.git. I also fixed a trivial
issue with checking exit ports.
- What's the reason for using threads? In theory, you have to make three
downloads with `search=$searchterm` in any case, regardless of the search
query, and you cannot process results before having all three responses.
Why add the complexity of using threads?
- Some ideas for making `calculate_sum` prettier:
- Calculating the sum in this function and dividing it outside of it
doesn't seem like what you want to do. You're really interested in the
average, both for bandwidth and uptime. Why not turn this function into
`calculate_2mo_avg`? In fact, callers shouldn't have to mess with the
graph history object at all, but that function should do everything from
removing data more than 2 months ago, summing up values, dividing by
count, and returning the average.
- The cleaner approach to skipping data that is more than 2 months old
is to start at `start` and move forward in `interval` steps until you're
at a datetime that's within the past 2 months. The reason is that Onionoo
bandwidth and uptime files don't contain exactly the past, say, 3 months
from the time you do the fetch, but they may return, for example, 3 months
1 week ago to 1 week ago. If you look at `start` and `interval`, you're
on the safe side.
- The `calculate_sum` function shouldn't divide by 1000.0, because
that's specific to bandwidth and not to uptime.
- You need to multiply all array elements in `values` with `factor`,
even in uptime documents.
- You're currently not adding `null` values to the sum, but you're
counting them when computing the average. For example, for `1, null, 2`
you calculate an average of `3 / 3 = 1`, but really the average is `3 / 2
= 1.5`.
Want to do another revision?
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9889#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list