\Drupal\strata\Estimate Projection

What a measurement is projected to cost.

Broken down rather than totalled, because the total answers no question anybody asks. An operator looking at a bill wants to know which realm is spending it, and the answer is almost always one of two things: files, which are most of the bytes and get almost none of the compression benefit, or the tree, which scales with how many subjects a site has rather than how busy it is.

Storage and requests are reported separately for the same reason. They are priced on different axes and pulled by different dials: bytes by retention and by what is captured, requests by the flush interval alone.

Summary

Methods
Properties
Constants
__construct
journalBytes
totalBytes
totalGigabytes
components
dominantComponent
share
monthlyCost
costs
summary
jsonSerialize
measurement
realmBytes
treeBytes
codeBytes
fileBytes
opsPerDay
writesPerMonth
readsPerMonth
compressionRatio
deltaReduction
collapse
notes
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Properties

$measurement

$measurement : \Drupal\strata\Estimate\Measurement

Type

Measurement

$realmBytes

$realmBytes : array

Type

array<string|int, mixed>

$treeBytes

$treeBytes : int

Type

int

$codeBytes

$codeBytes : int

Type

int

$fileBytes

$fileBytes : int

Type

int

$opsPerDay

$opsPerDay : float

Type

float

$writesPerMonth

$writesPerMonth : int

Type

int

$readsPerMonth

$readsPerMonth : int

Type

int

$compressionRatio

$compressionRatio : float

Type

float

$deltaReduction

$deltaReduction : float

Type

float

$collapse

$collapse : float

Type

float

$notes

$notes : array

Type

array<string|int, mixed>

Methods

__construct()

__construct(\Drupal\strata\Estimate\Measurement  $measurement, array  $realmBytes = [], int  $treeBytes = 0, int  $codeBytes = 0, int  $fileBytes = 0, float  $opsPerDay = 0.0, int  $writesPerMonth = 0, int  $readsPerMonth = 0, float  $compressionRatio = 1.0, float  $deltaReduction = 0.0, float  $collapse = 1.0, list  $notes = []) : mixed

Constructs a projection.

Parameters

\Drupal\strata\Estimate\Measurement $measurement

What was projected.

array $realmBytes

Realm value keyed to stored bytes over the retention period.

int $treeBytes

Stored bytes of base manifests over the retention period.

int $codeBytes

Stored bytes of the code realm over the retention period.

int $fileBytes

Stored bytes of file content, zero when the file realm is off.

float $opsPerDay

Operations captured a day.

int $writesPerMonth

Write requests a month, which is the flush count plus what compaction rewrites.

int $readsPerMonth

Read requests a month, which only verification and restore generate.

float $compressionRatio

The ratio applied to journal bytes.

float $deltaReduction

Share of journal bytes delta coding removed before compression.

float $collapse

The byte-weighted collapse factor the retention ladder achieves.

list $notes

What the reader should know about this projection, such as a dial that is doing most of the work or an input that was clamped.

Returns

mixed —

journalBytes()

journalBytes() : int

Stored bytes of captured operations, across every realm.

Returns

int —

Bytes.

totalBytes()

totalBytes() : int

Everything stored over the retention period.

Returns

int —

Bytes.

totalGigabytes()

totalGigabytes() : float

Everything stored, as gigabytes as a provider bills them.

Returns

float —

Gigabytes.

components()

components() : array<string,int>

What each component contributes, largest first.

Returns

array

Component name keyed to bytes.

dominantComponent()

dominantComponent() : string

Which component is spending the most.

Returns

string —

The component name, or an empty string when nothing is stored.

share()

share(string  $component) : float

What share of the stored bytes one component is.

Parameters

string $component

The component name.

Returns

float —

A fraction between 0 and 1.

monthlyCost()

monthlyCost(\Drupal\strata\Estimate\PriceTable  $prices) : float

The monthly bill on one provider.

Parameters

\Drupal\strata\Estimate\PriceTable $prices

The table to cost against.

Returns

float —

Dollars a month.

costs()

costs() : array<string,float>

The monthly bill on every shipped provider.

Returns

array

Provider id keyed to dollars a month.

summary()

summary() : string

One line describing the projection.

Returns

string —

The summary.

jsonSerialize()

jsonSerialize() : array<string,mixed>

{@inheritdoc}

Returns

array

The projection as data.