class PerformanceTestRecorder implements EventSubscriberInterface (View source)

Records the number of times specific events occur.

Properties

protected StateInterface $service

The state service for persistent storage if necessary.

static protected array $record

Methods

__construct(bool $persistent, StateInterface|null $state)

PerformanceTestRecorder constructor.

int
getCount(string $type, string $name)

No description

void
record(string $type, string $name)

Records the occurrence of an event.

onRouteBuilderFinish()

Records a router rebuild.

static array
getSubscribedEvents()

{@inheritdoc}

static void
registerService(string $services_file, bool $persistent)

Registers core.performance.test.recorder service.

Details

__construct(bool $persistent, StateInterface|null $state)

PerformanceTestRecorder constructor.

Parameters

bool $persistent

Whether to save the record to state.

StateInterface|null $state

(optional) The state service for persistent storage. Required if $persistent is TRUE.

int getCount(string $type, string $name)

No description

Parameters

string $type
string $name

Return Value

int

void record(string $type, string $name)

Records the occurrence of an event.

Parameters

string $type

The type of event to record.

string $name

The name of the event to record.

Return Value

void

onRouteBuilderFinish()

Records a router rebuild.

static array getSubscribedEvents()

{@inheritdoc}

Return Value

array

static void registerService(string $services_file, bool $persistent)

Registers core.performance.test.recorder service.

Parameters

string $services_file

Path to the services file to register the service in.

bool $persistent

Whether the recorder should be in persistent mode. The persistent mode records using the state service so that the recorder will work on the site under test when requests are made. However, if we want to measure something used by the state system then this will be recursive. Also in kernel tests using state is unnecessary.

Return Value

void