This module provides functionality for tracking bridge stability metrics.
Bridge stability metrics are calculated using the model introduced in `”An Analysis of Tor Bridge Stability”`_ and `implemented in the Tor Metrics library`_.
BridgeHistory
(fingerprint, ip, port, weightedUptime, weightedTime, weightedRunLength, totalRunWeights, lastSeenWithDifferentAddressAndPort, lastSeenWithThisAddressAndPort, lastDiscountedHistoryValues, lastUpdatedWeightedTime)[source]¶Bases: object
Record Class that tracks a single Bridge The fields stored are:
fingerprint, ip, port, weightedUptime, weightedTime, weightedRunLength, totalRunWeights, lastSeenWithDifferentAddressAndPort, lastSeenWithThisAddressAndPort, lastDiscountedHistoryValues.
fingerprint The Bridge Fingerprint (unicode) ip The Bridge IP (unicode) port The Bridge orport (integer)
weightedUptime Weighted uptime in seconds (long int) weightedTime Weighted time in seconds (long int) weightedRunLength Weighted run length of previous addresses or ports in
seconds. (long int)
discountWeightedFractionalUptimeAndWeightedTime
(discountUntilMillis)[source]¶discount weighted times
numDiscountRounds
(discountUntilMillis)[source]¶return the number of rounds of discounting needed to bring this history element current
weightedFractionalUptime
¶Weighted Fractional Uptime
tosa
¶the Time On Same Address (TOSA)
familiar
¶A bridge is ‘familiar’ if 1/8 of all active bridges have appeared more recently than it, or if it has been around for a Weighted Time of 8 days.
wmtbac
¶Weighted Mean Time Between Address Change
updateBridgeHistory
(bridges, timestamps)[source]¶Process all the timestamps and update the bridge stability statistics in the database.
Parameters: |
|
---|---|
Return type: | |
Returns: | The original timestamps, but which each list of integers (re)sorted. |