org.gudy.azureus2.core3.stats.transfer.impl
Class OverallStatsImpl

java.lang.Object
  extended by org.gudy.azureus2.core3.global.GlobalManagerAdapter
      extended by org.gudy.azureus2.core3.stats.transfer.impl.OverallStatsImpl
All Implemented Interfaces:
GlobalManagerListener, GeneralStats, OverallStats

public class OverallStatsImpl
extends GlobalManagerAdapter
implements OverallStats

Author:
Olivier

Field Summary
protected  AEMonitor this_mon
           
 
Constructor Summary
OverallStatsImpl(AzureusCore _core, GlobalManagerStats _gm_stats)
           
 
Method Summary
 void clearMark()
           
 void destroyInitiated()
           
 int getAverageDownloadSpeed()
           
 int getAverageDownloadSpeed(boolean since_mark)
           
 int getAverageUploadSpeed()
           
 int getAverageUploadSpeed(boolean since_mark)
           
 long getDownloadedBytes()
           
 long getDownloadedBytes(boolean since_mark)
          Method variants that can return values relative to the last mark
protected  long[] getLastSnapshot()
           
protected  long getLong(Map map, String name)
           
 long getMarkTime()
           
 long getSessionUpTime()
           
 long getTotalUpTime()
           
 long getTotalUpTime(boolean since_mark)
           
 long getUploadedBytes()
           
 long getUploadedBytes(boolean since_mark)
           
 void setMark()
          Sets a mark against the overall up/down/uptime so that the methods that report relative to the mark return values relative to it
 
Methods inherited from class org.gudy.azureus2.core3.global.GlobalManagerAdapter
destroyed, downloadManagerAdded, downloadManagerRemoved, seedingStatusChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

this_mon

protected AEMonitor this_mon
Constructor Detail

OverallStatsImpl

public OverallStatsImpl(AzureusCore _core,
                        GlobalManagerStats _gm_stats)
Method Detail

getLong

protected long getLong(Map map,
                       String name)

getAverageDownloadSpeed

public int getAverageDownloadSpeed()
Specified by:
getAverageDownloadSpeed in interface GeneralStats
Returns:
the average download speed in bytes per second

getAverageUploadSpeed

public int getAverageUploadSpeed()
Specified by:
getAverageUploadSpeed in interface GeneralStats
Returns:
the average upload speed in bytes per second

getDownloadedBytes

public long getDownloadedBytes()
Specified by:
getDownloadedBytes in interface GeneralStats
Returns:
the number of downloaded bytes

getUploadedBytes

public long getUploadedBytes()
Specified by:
getUploadedBytes in interface GeneralStats
Returns:
the number of uploaded bytes

getTotalUpTime

public long getTotalUpTime()
Specified by:
getTotalUpTime in interface GeneralStats
Returns:
the total lifetime 'up time' in seconds

getDownloadedBytes

public long getDownloadedBytes(boolean since_mark)
Description copied from interface: GeneralStats
Method variants that can return values relative to the last mark

Specified by:
getDownloadedBytes in interface GeneralStats
Returns:

getUploadedBytes

public long getUploadedBytes(boolean since_mark)
Specified by:
getUploadedBytes in interface GeneralStats

getTotalUpTime

public long getTotalUpTime(boolean since_mark)
Specified by:
getTotalUpTime in interface GeneralStats

getAverageDownloadSpeed

public int getAverageDownloadSpeed(boolean since_mark)
Specified by:
getAverageDownloadSpeed in interface GeneralStats

getAverageUploadSpeed

public int getAverageUploadSpeed(boolean since_mark)
Specified by:
getAverageUploadSpeed in interface GeneralStats

getMarkTime

public long getMarkTime()
Specified by:
getMarkTime in interface GeneralStats

setMark

public void setMark()
Description copied from interface: GeneralStats
Sets a mark against the overall up/down/uptime so that the methods that report relative to the mark return values relative to it

Specified by:
setMark in interface GeneralStats

clearMark

public void clearMark()
Specified by:
clearMark in interface GeneralStats

getSessionUpTime

public long getSessionUpTime()
Specified by:
getSessionUpTime in interface GeneralStats
Returns:
this session uptime in seconds

destroyInitiated

public void destroyInitiated()
Specified by:
destroyInitiated in interface GlobalManagerListener
Overrides:
destroyInitiated in class GlobalManagerAdapter

getLastSnapshot

protected long[] getLastSnapshot()