Documentation

BandwidthStatsTracker
in package

Table of Contents

$bytesSinceLastRotation  : int
$history  : array<string|int, int>
$nextHistoryIndex  : int
$totalBytes  : int
__construct()  : mixed
add()  : void
getAverageBytes()  : float
Returns the average of all the tracked history values.
getTotalBytes()  : int
resetHistory()  : void
rotateHistory()  : void
Adds the bytes tracked since the last rotation to the history array, overwriting an old entry.

Properties

Methods

__construct()

public __construct(int $historySize) : mixed
Parameters
$historySize : int
Tags
phpstan-param

positive-int $historySize

Return values
mixed

getAverageBytes()

Returns the average of all the tracked history values.

public getAverageBytes() : float
Return values
float

rotateHistory()

Adds the bytes tracked since the last rotation to the history array, overwriting an old entry.

public rotateHistory() : void

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).

Return values
void

Search results