public class RelayStatusGenerator
extends java.lang.Object
Constructor and Description |
---|
RelayStatusGenerator() |
Modifier and Type | Method and Description |
---|---|
static MicroblogStatus |
generateAgeTweet(Relay relay)
Returns a tweet about how long the relay has been contributing to the Tor
network.
|
static MicroblogStatus |
generateBandwidthTweet(Relay relay)
Returns a tweet about how much bandwidth a relay is contributing to the Tor
network.
|
public static MicroblogStatus generateAgeTweet(Relay relay) throws OnionooMissingInformationException
An example tweet looks like:
Aramis66 in United States has been contributing to the #Tor network for 154 days and 2 hours. https://metrics.torproject.org/rs.html#details/637BD268843638713D6FC13A92B3E36F4B5B0F4B
This function requires that "country_name" has a useful value in the RelayDetails object.
relay
- A RelayDetails object for the relay to have a tweet generated.OnionooMissingInformationException
- when information required to generate the tweet is missing from
the RelayDetails object (probably because Onionoo did not have
it)public static MicroblogStatus generateBandwidthTweet(Relay relay) throws OnionooMissingInformationException
An example tweet looks like:
BeastieJoy60 in Germany is contributing 11.1MiB/s bandwidth to the #Tor network. https://metrics.torproject.org/rs.html#details/B86137AE9681701901C6720E55C16805B46BD8E3
This function requires that both "country_name" and "advertised_bandwidth" have useful values in the RelayDetails object. "advertised_bandwidth" is not considered useful is "measured" is false in the Onionoo document.
relay
- A RelayDetails object for the relay to have a tweet generated.OnionooMissingInformationException
- when information required to generate the tweet is missing from
the RelayDetails object (probably because Onionoo did not have
it)