AXIS_BYTES
AXIS_BYTES = 'bytes'
The bytes-per-month axis.
One budget reading: what a month at the observed rate comes to, and what Strata does about it.
Readonly, because a reading describes a moment. A later window produces a new assessment rather than editing this one, so a figure surfaced in a report cannot drift from the rung that was derived from it.
__construct(string $rung, float $usedFraction, int $projectedBytes, float $projectedDollars, int $bytesCeiling = 0, float $dollarsCeiling = 0.0, string|null $reason = null) : mixed
Constructs a reading.
| string | $rung | A rung name from EscalationLadder::RUNGS. |
| float | $usedFraction | Projected usage divided by the ceiling that binds. 0.0 when no ceiling is set, or when the window was too short to project from. |
| int | $projectedBytes | Bytes the store would be sent over a month at the observed rate. |
| float | $projectedDollars | What that month would cost, storage and requests together. |
| int | $bytesCeiling | The bytes-per-month ceiling in force; 0 means no ceiling on that axis. |
| float | $dollarsCeiling | The dollars-per-month ceiling in force; 0.0 means no ceiling on that axis. |
| string|null | $reason | AXIS_BYTES or AXIS_DOLLARS, naming the axis that produced $usedFraction. NULL when neither ceiling is set, or when nothing could be projected. |
withRung(string $rung) : self
The same reading held to a different rung.
The measurement is unchanged; only what the site has agreed to do about it moves. Used to hold
a measured rung down to the one budget.action allows.
| string | $rung | The rung to report. |
A new reading, since this one is readonly.
readableBytes(int $bytes) : string
Formats a byte count for an operator-facing line.
Steps by 1024, matching the gigabyte storage is priced by in BudgetGuard. Never parse the result; it is for a table cell or a log line.
| int | $bytes | The count. |
A string such as "1.5 GB", or "0 B" for nothing.