Changes between Initial Version and Version 1 of Ticket #18967, comment 11


Ignore:
Timestamp:
May 30, 2016, 4:32:40 PM (4 years ago)
Author:
seansaito
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18967, comment 11

    initial v1  
    66https://github.com/seansaito/Roster/blob/master/app/models/family_aggregator.py
    77
    8 Basically each family will be stored in a JSON dictionary, where the key is the oldest/largest fingerprint.
     8To summarize the script, each relay is grouped into a family dictionary object via the extended_family field. The family dictionary object aggregates most of the relay's attributes, including bandwidth, consensus_weight, countries. For fields such as last_seen and maximum_uptime, the family object takes the earliest / longest record. Each family is initialized as a dictionary with the following keys:
     9
     10{{{
     11family = {"observed_bandwidth": 0,
     12           "exit_bandwidth": 0,
     13           "consensus_weight_fraction": 0,
     14           "consensus_weight": 0,
     15           "families": [], # This stores each relay document within that document.
     16           "contact": [],
     17           "middle_probability": 0,
     18           "exit_probability": 0, "bitcoin_addr": "None",
     19           "bandwidth_points": 0, "consensus_points": 0,
     20           "last_seen": str(datetime.datetime.now()),
     21           "maximum_uptime": str(datetime.datetime.now()),
     22           "countries": [], "exit": 0, "guard": 0,
     23           "t_shirts": [],
     24           "eligible_for_tshirt": False}
     25}}}
     26
     27Here is a sample output of aggregating relays into families:
     28https://github.com/seansaito/Roster/blob/master/sample_family.json
     29
     30The scheme I am proposing will hash these family objects by oldest/largest fingerprint, and add persistence to the data.
    931
    1032If a creation of a Family Document seems too time/effort consuming, I can first implement a similar scheme specifically for Roster and see how it goes. What do you think?