Package com.biglybt.core.global.impl
Class GlobalManagerStatsImpl
- java.lang.Object
-
- com.biglybt.core.global.impl.GlobalManagerStatsImpl
-
- All Implemented Interfaces:
GlobalManagerStats
,SimpleTimer.TimerTickReceiver
public class GlobalManagerStatsImpl extends java.lang.Object implements GlobalManagerStats, SimpleTimer.TimerTickReceiver
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
GlobalManagerStatsImpl.AggregateStatsDownloadWrapper
private static class
GlobalManagerStatsImpl.AggregateStatsImpl
private class
GlobalManagerStatsImpl.AggregateStatsWrapper
private static class
GlobalManagerStatsImpl.CountryDetailsImpl
private static class
GlobalManagerStatsImpl.HistoryEntry
private static class
GlobalManagerStatsImpl.PeerDetails
-
Nested classes/interfaces inherited from interface com.biglybt.core.global.GlobalManagerStats
GlobalManagerStats.AggregateStats, GlobalManagerStats.CountryDetails, GlobalManagerStats.RemoteCountryStats, GlobalManagerStats.RemoteStats
-
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
GlobalManagerStatsImpl()
protected
GlobalManagerStatsImpl(GlobalManagerImpl _manager)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biglybt.core.global.GlobalManagerStats
getTotalDataProtocolBytesReceived, getTotalDataProtocolBytesSent
-
-
-
-
Field Detail
-
manager
private final GlobalManagerImpl manager
-
smooth_last_sent
private long smooth_last_sent
-
smooth_last_received
private long smooth_last_received
-
current_smoothing_window
private int current_smoothing_window
-
current_smoothing_interval
private int current_smoothing_interval
-
smoothed_receive_rate
private GeneralUtils.SmoothAverage smoothed_receive_rate
-
smoothed_send_rate
private GeneralUtils.SmoothAverage smoothed_send_rate
-
total_data_bytes_received
private long total_data_bytes_received
-
total_protocol_bytes_received
private long total_protocol_bytes_received
-
totalDiscarded
private long totalDiscarded
-
total_data_bytes_sent
private long total_data_bytes_sent
-
total_protocol_bytes_sent
private long total_protocol_bytes_sent
-
data_send_speed_at_close
private int data_send_speed_at_close
-
data_receive_speed
private final Average data_receive_speed
-
protocol_receive_speed
private final Average protocol_receive_speed
-
data_receive_speed_no_lan
private final Average data_receive_speed_no_lan
-
protocol_receive_speed_no_lan
private final Average protocol_receive_speed_no_lan
-
data_send_speed
private final Average data_send_speed
-
protocol_send_speed
private final Average protocol_send_speed
-
data_send_speed_no_lan
private final Average data_send_speed_no_lan
-
protocol_send_speed_no_lan
private final Average protocol_send_speed_no_lan
-
PEER_DATA_INIT_KEY
private static final java.lang.Object PEER_DATA_INIT_KEY
-
PEER_DATA_KEY
private static final java.lang.Object PEER_DATA_KEY
-
PEER_DATA_FINAL_KEY
private static final java.lang.Object PEER_DATA_FINAL_KEY
-
DOWNLOAD_DATA_KEY
private static final java.lang.Object DOWNLOAD_DATA_KEY
-
removed_peers
private java.util.Map<DownloadManager,java.util.List<PEPeer>> removed_peers
-
country_details
private java.util.Map<java.lang.String,GlobalManagerStats.CountryDetails> country_details
-
country_total
private GlobalManagerStatsImpl.CountryDetailsImpl country_total
-
country_details_seq
private java.util.concurrent.atomic.AtomicInteger country_details_seq
-
country_my_cc
private java.lang.String country_my_cc
-
stats_dispatcher
private AsyncDispatcher stats_dispatcher
-
pending_stats
private java.util.concurrent.ConcurrentHashMap<java.net.InetAddress,GlobalManagerStats.RemoteStats> pending_stats
-
STATS_HISTORY_MAX_AGE
private static final long STATS_HISTORY_MAX_AGE
- See Also:
- Constant Field Values
-
STATS_HISTORY_MAX_SAMPLES
private static final long STATS_HISTORY_MAX_SAMPLES
- See Also:
- Constant Field Values
-
MAX_ALLOWED_BYTES_PER_MIN
private static final long MAX_ALLOWED_BYTES_PER_MIN
- See Also:
- Constant Field Values
-
aggregate_stats
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,long[]>> aggregate_stats
-
sequence
private int sequence
-
total_received_overall
private long total_received_overall
-
total_sent_overall
private long total_sent_overall
-
as_remote_latest
private volatile GlobalManagerStatsImpl.AggregateStatsImpl as_remote_latest
-
dht_biglybt
private DHT dht_biglybt
-
stats_history
private java.util.LinkedList<GlobalManagerStatsImpl.HistoryEntry> stats_history
-
stats_history_addresses
private java.util.Set<java.net.InetAddress> stats_history_addresses
-
as_remote_wrapper
private GlobalManagerStatsImpl.AggregateStatsWrapper as_remote_wrapper
-
as_local_wrapper
private GlobalManagerStatsImpl.AggregateStatsWrapper as_local_wrapper
-
-
Constructor Detail
-
GlobalManagerStatsImpl
protected GlobalManagerStatsImpl()
-
GlobalManagerStatsImpl
protected GlobalManagerStatsImpl(GlobalManagerImpl _manager)
-
-
Method Detail
-
load
protected void load()
-
save
protected void save()
-
getDataSendRateAtClose
public int getDataSendRateAtClose()
- Specified by:
getDataSendRateAtClose
in interfaceGlobalManagerStats
-
discarded
public void discarded(int length)
- Specified by:
discarded
in interfaceGlobalManagerStats
-
dataBytesReceived
public void dataBytesReceived(int length, boolean LAN)
- Specified by:
dataBytesReceived
in interfaceGlobalManagerStats
-
protocolBytesReceived
public void protocolBytesReceived(int length, boolean LAN)
- Specified by:
protocolBytesReceived
in interfaceGlobalManagerStats
-
dataBytesSent
public void dataBytesSent(int length, boolean LAN)
- Specified by:
dataBytesSent
in interfaceGlobalManagerStats
-
protocolBytesSent
public void protocolBytesSent(int length, boolean LAN)
- Specified by:
protocolBytesSent
in interfaceGlobalManagerStats
-
getDataReceiveRate
public int getDataReceiveRate()
Description copied from interface:GlobalManagerStats
Data Receive Rate over the last 10s- Specified by:
getDataReceiveRate
in interfaceGlobalManagerStats
-
getDataReceiveRateNoLAN
public int getDataReceiveRateNoLAN()
- Specified by:
getDataReceiveRateNoLAN
in interfaceGlobalManagerStats
-
getDataReceiveRateNoLAN
public int getDataReceiveRateNoLAN(int average_period)
- Specified by:
getDataReceiveRateNoLAN
in interfaceGlobalManagerStats
-
getProtocolReceiveRate
public int getProtocolReceiveRate()
- Specified by:
getProtocolReceiveRate
in interfaceGlobalManagerStats
-
getProtocolReceiveRateNoLAN
public int getProtocolReceiveRateNoLAN()
- Specified by:
getProtocolReceiveRateNoLAN
in interfaceGlobalManagerStats
-
getProtocolReceiveRateNoLAN
public int getProtocolReceiveRateNoLAN(int average_period)
- Specified by:
getProtocolReceiveRateNoLAN
in interfaceGlobalManagerStats
-
getDataAndProtocolReceiveRate
public int getDataAndProtocolReceiveRate()
- Specified by:
getDataAndProtocolReceiveRate
in interfaceGlobalManagerStats
-
getDataSendRate
public int getDataSendRate()
Description copied from interface:GlobalManagerStats
Data Send Rate over the last 10s- Specified by:
getDataSendRate
in interfaceGlobalManagerStats
-
getDataSendRateNoLAN
public int getDataSendRateNoLAN()
- Specified by:
getDataSendRateNoLAN
in interfaceGlobalManagerStats
-
getDataSendRateNoLAN
public int getDataSendRateNoLAN(int average_period)
- Specified by:
getDataSendRateNoLAN
in interfaceGlobalManagerStats
-
getProtocolSendRate
public int getProtocolSendRate()
- Specified by:
getProtocolSendRate
in interfaceGlobalManagerStats
-
getProtocolSendRateNoLAN
public int getProtocolSendRateNoLAN()
- Specified by:
getProtocolSendRateNoLAN
in interfaceGlobalManagerStats
-
getProtocolSendRateNoLAN
public int getProtocolSendRateNoLAN(int average_period)
- Specified by:
getProtocolSendRateNoLAN
in interfaceGlobalManagerStats
-
getDataAndProtocolSendRate
public int getDataAndProtocolSendRate()
- Specified by:
getDataAndProtocolSendRate
in interfaceGlobalManagerStats
-
getTotalDataBytesSent
public long getTotalDataBytesSent()
- Specified by:
getTotalDataBytesSent
in interfaceGlobalManagerStats
-
getTotalProtocolBytesSent
public long getTotalProtocolBytesSent()
- Specified by:
getTotalProtocolBytesSent
in interfaceGlobalManagerStats
-
getTotalDataBytesReceived
public long getTotalDataBytesReceived()
- Specified by:
getTotalDataBytesReceived
in interfaceGlobalManagerStats
-
getTotalProtocolBytesReceived
public long getTotalProtocolBytesReceived()
- Specified by:
getTotalProtocolBytesReceived
in interfaceGlobalManagerStats
-
getTotalDiscardedRaw
public long getTotalDiscardedRaw()
-
getTotalSwarmsPeerRate
public long getTotalSwarmsPeerRate(boolean downloading, boolean seeding)
- Specified by:
getTotalSwarmsPeerRate
in interfaceGlobalManagerStats
-
getSmoothedSendRate
public long getSmoothedSendRate()
Description copied from interface:GlobalManagerStats
Smoothed Send Rate, including data and protocol, based on "Stats Smoothing Secs" (default to 60s, min 30s)- Specified by:
getSmoothedSendRate
in interfaceGlobalManagerStats
-
getSmoothedReceiveRate
public long getSmoothedReceiveRate()
Description copied from interface:GlobalManagerStats
Smoothed Receive Rate, including data and protocol, based on "Stats Smoothing Secs" (default to 60s, min 30s)- Specified by:
getSmoothedReceiveRate
in interfaceGlobalManagerStats
-
getCountryDetails
public java.util.Iterator<GlobalManagerStats.CountryDetails> getCountryDetails()
- Specified by:
getCountryDetails
in interfaceGlobalManagerStats
-
tick
public void tick(long mono_now, int tick_count)
- Specified by:
tick
in interfaceSimpleTimer.TimerTickReceiver
-
receiveRemoteStats
public void receiveRemoteStats(GlobalManagerStats.RemoteStats stats)
- Specified by:
receiveRemoteStats
in interfaceGlobalManagerStats
-
addRemoteStats
private void addRemoteStats(GlobalManagerStats.RemoteStats stats)
-
getAggregateRemoteStats
public GlobalManagerStats.AggregateStats getAggregateRemoteStats()
- Specified by:
getAggregateRemoteStats
in interfaceGlobalManagerStats
-
getAggregateLocalStats
public GlobalManagerStats.AggregateStats getAggregateLocalStats()
- Specified by:
getAggregateLocalStats
in interfaceGlobalManagerStats
-
getAggregateLocalStats
public GlobalManagerStats.AggregateStats getAggregateLocalStats(DownloadManager dm)
- Specified by:
getAggregateLocalStats
in interfaceGlobalManagerStats
-
-