\Drupal\strata\Timeline TimelineBucket

What happened inside one bucket of a timeline.

Holds the commit ids as well as the totals, because a bucket is clickable: a reader who sees a spike wants the commits that made it, and re-querying by time range would give a different set from the one that was drawn if a flush landed in between.

The id list is bounded. A bucket at the day resolution on a busy site covers thousands of commits, and a chart holding all of them would spend more on the ids than on the numbers. Past the cap the count still rises, so the bar's height stays honest and only the drilldown is partial.

Summary

Methods
Properties
Constants
__construct
isEmpty
ratio
rate
startSecond
hasEveryId
jsonSerialize
startMicrotime
endMicrotime
commits
operations
rawBytes
storedBytes
anchors
ids
restores
MAX_IDS
No protected methods found
No protected properties found
No protected constants found
No private methods found
No private properties found
No private constants found

Constant

MAX_IDS

MAX_IDS = 32

Commit ids one bucket carries.

Properties

$startMicrotime

$startMicrotime : int

Type

int

$endMicrotime

$endMicrotime : int

Type

int

$commits

$commits : int

Type

int

$operations

$operations : int

Type

int

$rawBytes

$rawBytes : int

Type

int

$storedBytes

$storedBytes : int

Type

int

$anchors

$anchors : int

Type

int

$ids

$ids : array

Type

array<string|int, mixed>

$restores

$restores : int

Type

int

Methods

__construct()

__construct(int  $startMicrotime, int  $endMicrotime, int  $commits = 0, int  $operations = 0, int  $rawBytes = 0, int  $storedBytes = 0, int  $anchors = 0, list  $ids = [], int  $restores = 0) : mixed

Constructs a bucket.

Parameters

int $startMicrotime

The bucket's start, in unix microseconds.

int $endMicrotime

The bucket's end, in unix microseconds.

int $commits

How many commits fell in it.

int $operations

Operations those commits carried.

int $rawBytes

Bytes before compression.

int $storedBytes

Bytes actually written.

int $anchors

How many of the commits were base anchors.

list $ids

Commit ids, up to MAX_IDS of them.

int $restores

How many restores were run inside the bucket.

Returns

mixed —

isEmpty()

isEmpty() : bool

Whether nothing happened in this bucket.

Returns

bool —

TRUE when no commit fell in it.

ratio()

ratio() : float

The compression ratio across the bucket.

Returns

float —

Raw over stored, or 1.0 when nothing was stored.

rate()

rate() : float

Operations a second inside the bucket.

Returns

float —

The rate.

startSecond()

startSecond() : int

The bucket's start as a unix second.

Returns

int —

Unix seconds.

hasEveryId()

hasEveryId() : bool

Whether the drilldown list is complete.

Returns

bool —

FALSE when more commits fell in the bucket than the id list holds.

jsonSerialize()

jsonSerialize() : array

{@inheritdoc}

Returns

array —