\Drupal\strata\Explore RemovalCost

What removing one commit would actually free.

The freed and retained lists are both reported because the retained one is the answer an operator did not expect. A commit that wrote four megabytes usually frees far less than that: its frames are shared with the commits around it, held as delta anchors by later versions of the same subject, or named as dictionaries by frames elsewhere in the store.

complete is false when the reachability walk could not finish, and then nothing here can be acted on. A partial walk cannot prove a frame is unreferenced, only that it did not happen to see a reference, and those are different claims.

Summary

Methods
Properties
Constants
__construct
frames
freedShare
summary
jsonSerialize
commit
freed
retained
bytes
complete
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

$commit

$commit : string

Type

string

$freed

$freed : array

Type

array<string|int, mixed>

$retained

$retained : array

Type

array<string|int, mixed>

$bytes

$bytes : int

Type

int

$complete

$complete : bool

Type

bool

Methods

__construct()

__construct(string  $commit, list  $freed = [], array  $retained = [], int  $bytes = 0, bool  $complete = true) : mixed

Constructs a removal cost.

Parameters

string $commit

The commit that was priced.

list $freed

Frame addresses nothing else would need.

array $retained

Frame address keyed to why it would still be needed.

int $bytes

Stored bytes the freed frames occupy.

bool $complete

Whether the reachability walk finished, and so whether any of this can be acted on.

Returns

mixed —

frames()

frames() : int

How many frames the commit references in total.

Returns

int —

Freed plus retained.

freedShare()

freedShare() : float

The share of the commit's frames that removing it would actually free.

Returns

float —

Between 0.0 and 1.0, or 0.0 when the commit references nothing.

summary()

summary() : string

A one-line summary.

Returns

string —

What would go and what would stay.

jsonSerialize()

jsonSerialize() : array

{@inheritdoc}

Returns

array —