Class ComputedNetworkFractions
- java.lang.Object
-
- org.torproject.metrics.stats.hidserv.ComputedNetworkFractions
-
- All Implemented Interfaces:
Document
public class ComputedNetworkFractions extends java.lang.Object implements Document
Computed fraction of hidden-service activity that a single relay is assumed to observe in the network. These fractions are computed from status entries and bandwidth weights in a network status consensus.
-
-
Constructor Summary
Constructors Constructor Description ComputedNetworkFractions(java.lang.String fingerprint, long validAfterMillis)
Instantiates a new fractions object using fingerprint and consensus valid-after time which together uniquely identify the object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object otherObject)
Returns whether this object contains the same fingerprint and consensus valid-after time as the passed object.java.lang.String[]
format()
Returns a string representation of this object, consisting of two strings: the first string contains fingerprint and valid-after date, the second string contains the concatenation of all other attributes.java.lang.String
getFingerprint()
double
getFractionDirOnionsSeen()
double
getFractionRendRelayedCells()
long
getValidAfterMillis()
int
hashCode()
Returns a (hopefully unique) hash code based on this object's fingerprint and consensus valid-after time.boolean
parse(java.lang.String[] formattedStrings)
Initializes this fractions object using the two provided strings that have been produced by the format method earlier and returns whether this operation was successful.void
setFractionDirOnionsSeen(double fractionDirOnionsSeen)
void
setFractionRendRelayedCells(double fractionRendRelayedCells)
-
-
-
Method Detail
-
getFingerprint
public java.lang.String getFingerprint()
-
getValidAfterMillis
public long getValidAfterMillis()
-
setFractionRendRelayedCells
public void setFractionRendRelayedCells(double fractionRendRelayedCells)
-
getFractionRendRelayedCells
public double getFractionRendRelayedCells()
-
setFractionDirOnionsSeen
public void setFractionDirOnionsSeen(double fractionDirOnionsSeen)
-
getFractionDirOnionsSeen
public double getFractionDirOnionsSeen()
-
equals
public boolean equals(java.lang.Object otherObject)
Returns whether this object contains the same fingerprint and consensus valid-after time as the passed object.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Returns a (hopefully unique) hash code based on this object's fingerprint and consensus valid-after time.- Overrides:
hashCode
in classjava.lang.Object
-
format
public java.lang.String[] format()
Returns a string representation of this object, consisting of two strings: the first string contains fingerprint and valid-after date, the second string contains the concatenation of all other attributes.
-
-