PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
|
Public Member Functions | |
__construct (int $historySize) | |
add (int $bytes) | |
getAverageBytes () | |
getTotalBytes () | |
resetHistory () | |
rotateHistory () | |
Definition at line 30 of file BandwidthStatsTracker.php.
pocketmine\network\BandwidthStatsTracker::__construct | ( | int | $historySize | ) |
@phpstan-param positive-int $historySize
Definition at line 38 of file BandwidthStatsTracker.php.
pocketmine\network\BandwidthStatsTracker::add | ( | int | $bytes | ) |
Definition at line 42 of file BandwidthStatsTracker.php.
pocketmine\network\BandwidthStatsTracker::getAverageBytes | ( | ) |
Returns the average of all the tracked history values.
Definition at line 63 of file BandwidthStatsTracker.php.
pocketmine\network\BandwidthStatsTracker::getTotalBytes | ( | ) |
Definition at line 47 of file BandwidthStatsTracker.php.
pocketmine\network\BandwidthStatsTracker::resetHistory | ( | ) |
Definition at line 67 of file BandwidthStatsTracker.php.
pocketmine\network\BandwidthStatsTracker::rotateHistory | ( | ) |
Adds the bytes tracked since the last rotation to the history array, overwriting an old entry. This should be called on a regular interval that you want to collect average measurements over (e.g. if you want bytes per second, call this every second).
Definition at line 54 of file BandwidthStatsTracker.php.