|
PocketMine-MP 5.36.1 git-eaa7c4834c8fe2f379d24e7f0ee6cc63cfb18ccc
|
Collaboration diagram for pocketmine\network\BandwidthStatsTracker: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.