LimeWire Consolidated API

com.limegroup.gnutella
Interface BandwidthTracker

All Known Subinterfaces:
BTDownloader, BTTorrentFileDownloader, CoreDownloader, Downloader, DownloadManager, InNetworkDownloader, MagnetDownloader, ManagedDownloader, MozillaDownload, ResumeDownloader, StoreDownloader, Uploader, UploadManager, UploadSlotListener, UploadSlotManager, UploadSlotUser
All Known Implementing Classes:
AbstractCoreDownloader, AbstractUploader, BTConnection, BTDownloaderImpl, BTTorrentFileDownloaderImpl, BTUploader, DownloadManagerImpl, HTTPDownloader, HTTPUploader, HTTPUploadManager, HTTPUploadSession, LimeMozillaDownloadProgressListenerImpl, MozillaDownloaderImpl, SimpleBandwidthTracker, UploadSlotManagerImpl

public interface BandwidthTracker

Defines the interface for any class wanting to track bandwidth. Typically a timer periodically calls measureBandwidth(), leaving other threads free to call getMeasuredBandwidth().


Method Summary
 float getAverageBandwidth()
          Returns the overall averaged bandwidth between all calls of measureBandwidth.
 float getMeasuredBandwidth()
          Returns the throughput of this in kilobytes/sec (KB/s) between the last two calls to measureBandwidth, or 0.0 if unknown.
 void measureBandwidth()
          Measures the data throughput since the last call to measureBandwidth.
 

Method Detail

measureBandwidth

void measureBandwidth()
Measures the data throughput since the last call to measureBandwidth. This value can be read by calling getMeasuredBandwidth.


getMeasuredBandwidth

float getMeasuredBandwidth()
                           throws InsufficientDataException
Returns the throughput of this in kilobytes/sec (KB/s) between the last two calls to measureBandwidth, or 0.0 if unknown.

Throws:
InsufficientDataException

getAverageBandwidth

float getAverageBandwidth()
Returns the overall averaged bandwidth between all calls of measureBandwidth.


LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.