public class PeerStatistic extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
RTT_CACHE_SIZE |
| Constructor and Description |
|---|
PeerStatistic(PeerAddress peerAddress)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
PeerStatistic |
addRTT(RTT rtt)
Adds a RTT to the cache.
|
boolean |
containsEstimates() |
long |
created() |
boolean |
equals(Object obj) |
int |
failed()
Increases the failed counter.
|
RTT |
getLatestRTT() |
long |
getMeanRTT()
Get the mean of the last 5 RTTs
|
long |
getNumberOfResponses() |
int |
getRTTCount()
How many RTT measurements are in the cache
|
int |
hashCode() |
void |
increaseNumberOfResponses() |
boolean |
isLocal() |
long |
lastSeenOnline() |
PeerStatistic |
local() |
int |
onlineTime() |
PeerAddress |
peerAddress() |
PeerAddress |
peerAddress(PeerAddress peerAddress)
Set the peer address only if the previous peer address that had the same peer ID.
|
PeerStatistic |
setLocal(boolean local) |
int |
successfullyChecked()
Sets the time when last seen online to now.
|
int |
successfullyCheckedCounter() |
public static final int RTT_CACHE_SIZE
public PeerStatistic(PeerAddress peerAddress)
peerAddress - The peer address that belongs to this statisticspublic int successfullyChecked()
public long lastSeenOnline()
public int successfullyCheckedCounter()
public int failed()
public long created()
public int onlineTime()
public long getNumberOfResponses()
public void increaseNumberOfResponses()
public PeerAddress peerAddress()
public PeerAddress peerAddress(PeerAddress peerAddress)
peerAddress - The updated peer IDpublic PeerStatistic local()
public boolean isLocal()
public PeerStatistic setLocal(boolean local)
public PeerStatistic addRTT(RTT rtt)
rtt - The RTT object that should be addedpublic boolean containsEstimates()
public RTT getLatestRTT()
public long getMeanRTT()
public int getRTTCount()
Copyright © 2015. All rights reserved.