\Drupal\strata\Drill DrillIndex

Where drill results are kept, so a pass or a failure is a trend rather than a moment.

One drill answering "yes" is weak evidence; the same drill answering "yes" every night for a month and then "no" is what an operator can act on. This is a local table because it is a record of what this site measured about its own store, and unlike everything under commits/ it cannot be rebuilt from the bucket. An uninstall exports it alongside the restore audit.

Only the counts and the verdict are kept, never the subject lists. A drill of every subject on a large site would put a hundred thousand paths in one row, and the paths are only useful while the failure is being investigated - which is what the report the drill just returned is for.

Summary

Methods
Properties
Constants
__construct
record
recent
newest
lastRunAt
verdicts
purge
clear
No public properties found
TABLE
No protected methods found
No protected properties found
No protected constants found
No private methods found
database
No private constants found

Constant

TABLE

TABLE = 'strata_drill'

The table this index lives in.

Properties

$database

$database : \Drupal\Core\Database\Connection

Type

Connection

Methods

__construct()

__construct(\Drupal\Core\Database\Connection  $database) : mixed

Constructs an index.

Parameters

\Drupal\Core\Database\Connection $database

The database.

Returns

mixed —

record()

record(\Drupal\strata\Drill\DrillReport  $report) : int

Records one drill.

Parameters

\Drupal\strata\Drill\DrillReport $report

What it found.

Returns

int —

The row id.

recent()

recent(int  $limit = 30) : list<array<string,mixed>>

The most recent drills, newest first.

Parameters

int $limit

Most rows to return.

Returns

list> —

The rows.

newest()

newest() : array<string,mixed>|null

The newest drill.

Returns

array|null —

The row, or NULL when no drill has run.

lastRunAt()

lastRunAt() : int

When the last drill ran.

Returns

int —

Unix seconds, or 0 when none has.

verdicts()

verdicts(int  $limit = 30) : array{passed: int, failed: int, inconclusive: int, refused: int}

How many of the last drills passed.

Parameters

int $limit

How many drills to look back over.

Returns

array{passed: int, failed: int, inconclusive: int, refused: int} —

Counts by verdict.

purge()

purge(int  $olderThan) : int

Removes drills older than a moment.

Parameters

int $olderThan

Unix seconds.

Returns

int —

How many rows were removed.

clear()

clear() : int

Drops every row.

Returns

int —

How many rows were removed.