\Drupal\strata\Storage ProviderStatSubscriber

Writes this request's store traffic into the per-day record once the response is out.

Terminate rather than response: the write is bookkeeping and the visitor should not wait on it. A request that never touched the store leaves an empty accumulator and costs no query, so the subscriber is registered unconditionally.

A failure here is logged and swallowed. Losing a day's request count is a gap in a cost report; letting the same failure out of a terminate listener would be a fatal on a page that has already been sent.

Summary

Methods
Properties
Constants
__construct
getSubscribedEvents
onTerminate
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
engine
logger
No private constants found

Properties

$engine

$engine : \Drupal\strata\Engine

Type

Engine

$logger

$logger : \Psr\Log\LoggerInterface

Type

LoggerInterface

Methods

__construct()

__construct(\Drupal\strata\Engine  $engine, \Psr\Log\LoggerInterface  $logger) : mixed

Constructs the subscriber.

Parameters

\Drupal\strata\Engine $engine

The engine holding the accumulator.

\Psr\Log\LoggerInterface $logger

Where a failed write is reported.

Returns

mixed —

getSubscribedEvents()

getSubscribedEvents() : array<string,string>

{@inheritdoc}

Returns

array

The events this subscriber listens to.

onTerminate()

onTerminate(\Symfony\Component\HttpKernel\Event\TerminateEvent  $event) : void

Persists whatever the request cost.

Parameters

\Symfony\Component\HttpKernel\Event\TerminateEvent $event

The terminate event, unused; the accumulator is on the engine.

Returns

void —