\Drupal\strata\Compaction CompactionReport

What one compaction pass did.

Split from the prune receipt on purpose. Recompression rewrites how bytes are stored and destroys nothing, so it reports totals; a prune destroys restore targets, so it produces a document. A pass that recompressed and then declined to prune is a success with a refusal in it, and the two halves have to be readable separately.

Summary

Methods
Properties
Constants
__construct
isClean
saved
gain
summary
jsonSerialize
packs
frames
bytesBefore
bytesAfter
skipped
prune
problems
seconds
No public constants found
No protected methods found
No protected properties found
No protected constants found
humanBytes
No private properties found
No private constants found

Properties

$packs

$packs : int

Type

int

$frames

$frames : int

Type

int

$bytesBefore

$bytesBefore : int

Type

int

$bytesAfter

$bytesAfter : int

Type

int

$skipped

$skipped : int

Type

int

$prune

$prune : ?\Drupal\strata\Compaction\PruneReceipt

Type

PruneReceipt|null

$problems

$problems : array

Type

array<string|int, mixed>

$seconds

$seconds : float

Type

float

Methods

__construct()

__construct(int  $packs = 0, int  $frames = 0, int  $bytesBefore = 0, int  $bytesAfter = 0, int  $skipped = 0, \Drupal\strata\Compaction\PruneReceipt|null  $prune = null, list  $problems = [], float  $seconds = 0.0) : mixed

Constructs a report.

Parameters

int $packs

Packs rewritten at the dense setting.

int $frames

Frames those packs carried.

int $bytesBefore

Stored bytes the rewritten packs occupied before.

int $bytesAfter

Stored bytes they occupy now.

int $skipped

Packs already dense enough to leave alone.

\Drupal\strata\Compaction\PruneReceipt|null $prune

What the prune half of the pass did, or NULL when no prune was asked for.

list $problems

One line per object the pass could not read.

float $seconds

How long it took.

Returns

mixed —

isClean()

isClean() : bool

Whether the pass read everything it reached for.

Returns

bool —

TRUE when nothing was skipped for being unreadable.

saved()

saved() : int

Stored bytes the pass freed.

Returns

int —

The difference between the before and after totals.

gain()

gain() : float

How much denser the rewritten packs became.

Returns

float —

Bytes before divided by bytes after, or 1.0 when nothing was rewritten.

summary()

summary() : string

A one-line summary for a log entry or a command's output.

Returns

string —

The summary.

jsonSerialize()

jsonSerialize() : array<string,mixed>

{@inheritdoc}

Returns

array

The report as a plain array.

humanBytes()

humanBytes(int  $bytes) : string

Renders a byte count at a readable scale.

Parameters

int $bytes

The count.

Returns

string —

For example "4.2 MiB".