[tor-bugs] #9889 [Atlas]: Add "Tshirt: yes/no" to Atlas and Globe
Tor Bug Tracker & Wiki
blackhole at torproject.org
Wed Mar 19 21:35:13 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 sreenatha):
Hi Karsten! Thank you for the feedback. I've cloned the metrics-tasks
repository and added a task-9889 directory as you suggested. After some
time hacking around, I've come up with two versions of the tshirt
code(with and without multi-threading), both of which can be found at the
following URL.
https://github.com/lucyd/metrics-
tasks/commits/mybranch/task-9889/tshirt.py
* In the normal approach, I've incorporated the changes suggested along
with some other that were missing previously like checking in the port
'''ranges''' of `exit_policy_summary`.
* In the multi-threaded approach, each of the threads invoked handles a
single relay's data.
* The ''check_tshirt'' method fetches required onionoo documents and
stores them in global variables for the threads to access individual
entries.
* Synchronization across threads which share the global variables has
been ensured using a binary lock.
* On execution, each of the threads calculates the relay uptime,
bandwidth and exit allowance details. After calculation, the thread lock
is acquired and the information is sent to ''print_debug_info'' before
releasing the lock for other threads.
* There is no strict order of execution of the threads. I don't see how
that can be a problem though.
Should I split the script into two files? One part could fetch the
bandwidth, uptime, details documents and store them locally while the
second part reads these documents and runs the threads. These two scripts
could then be run sequentially with a shell script.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/9889#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list