\Drupal\strata\File FileReport

What capturing one file did.

Reports the uploaded bytes separately from the file's own size, because the whole claim of the file realm is that those two numbers are different: a 2 MiB edit to a 256 MiB file uploads 2.1 MiB, and a report that only said "captured video.mp4" would hide whether that held.

Summary

Methods
Properties
Constants
__construct
skipped
uploadShare
saved
summary
jsonSerialize
ran
path
blocks
uploaded
shared
bytes
length
changedRatio
shifted
firstCapture
skipped
seconds
No public constants found
No protected methods found
No protected properties found
No protected constants found
format
No private properties found
No private constants found

Properties

$ran

$ran : bool

Type

bool

$path

$path : string

Type

string

$blocks

$blocks : int

Type

int

$uploaded

$uploaded : int

Type

int

$shared

$shared : int

Type

int

$bytes

$bytes : int

Type

int

$length

$length : int

Type

int

$changedRatio

$changedRatio : float

Type

float

$shifted

$shifted : bool

Type

bool

$firstCapture

$firstCapture : bool

Type

bool

$skipped

$skipped : string

Type

string

$seconds

$seconds : float

Type

float

Methods

__construct()

__construct(bool  $ran = false, string  $path = '', int  $blocks = 0, int  $uploaded = 0, int  $shared = 0, int  $bytes = 0, int  $length = 0, float  $changedRatio = 0.0, bool  $shifted = false, bool  $firstCapture = false, string  $skipped = '', float  $seconds = 0.0) : mixed

Constructs a report.

Parameters

bool $ran

Whether anything was stored.

string $path

The file, as it was recorded.

int $blocks

How many blocks the version has.

int $uploaded

How many of those blocks were new.

int $shared

How many were already in the store, from another version or another file.

int $bytes

Bytes uploaded.

int $length

The file's own length.

float $changedRatio

Share of block positions whose content differs from the previous version.

bool $shifted

Whether the change looks like a shift rather than an edit.

bool $firstCapture

Whether this was the file's first version.

string $skipped

Why nothing was stored, empty when something was.

float $seconds

How long the capture took.

Returns

mixed —

skipped()

skipped(string  $path, string  $reason, float  $started) : \Drupal\strata\File\FileReport

A report for a file nothing was done to.

Parameters

string $path

The file.

string $reason

Why.

float $started

When the attempt began, as a microtime float.

Returns

\Drupal\strata\File\FileReport —

The report.

uploadShare()

uploadShare() : float

What share of the file was uploaded.

The number the whole design rests on: 0.81% for a measured 2 MiB in-place edit on a 256 MiB file, against 100% for whole-object storage.

Returns

float —

A fraction between 0 and 1.

saved()

saved() : int

How many bytes storing this version saved against storing the file whole.

Returns

int —

Bytes.

summary()

summary() : string

One line describing the capture.

Returns

string —

The summary.

jsonSerialize()

jsonSerialize() : array<string,mixed>

{@inheritdoc}

Returns

array

The report as data.

format()

format(int  $bytes) : string

A byte count in the largest unit that stays readable.

Parameters

int $bytes

The count.

Returns

string —

Something such as "2.1 MiB".