You are here

public function PurgerCapacityDataInterface::hasRuntimeMeasurement in Purge 8.3

Indicates whether your purger utilizes dynamic runtime measurement.

Implementations of this method should simply return TRUE or FALSE but the consequences of it have to be thoroughly understood. Either scenarios and the resulting behavior explained:

Dynamic runtime measurement enabled (TRUE):

In other words, returning TRUE will give you automatic adaptive performance throttling based on data, gathered by automatically set performance counters. When your purgers execute slow, less will be fed in the next call to ::invalidate(). When it performs much better, it will incrementally increase the amount it feeds, over the several next calls to ::invalidate.

Dynamic runtime measurement disabled (FALSE):

  • No calls will be made to ::setRuntimeMeasurement().
  • No calls will be made to ::getRuntimeMeasurement().
  • Your ::getTimeHint() implementation will not use dynamic runtime tracking and carefully and responsibly define the right time hints.

So returning FALSE, makes you responsible for the complex task of defining a realistic time limit in which your code executes at all times. This is so complex, because real-world circumstances (e.g. HTTP delays) can cause sudden drops in productivity, which cannot come at the expense of Drupal's overal stability. This is why Purge rather throttles its own work, than letting things explode in front of the end-user.

Return value

bool Whether dynamic runtime measurement is used and should be injected.

1 call to PurgerCapacityDataInterface::hasRuntimeMeasurement()
PurgerBase::getTimeHint in src/Plugin/Purge/Purger/PurgerBase.php
Get the maximum number of seconds, processing a single invalidation takes.
1 method overrides PurgerCapacityDataInterface::hasRuntimeMeasurement()
NullPurgerBase::hasRuntimeMeasurement in tests/modules/purge_purger_test/src/Plugin/Purge/Purger/NullPurgerBase.php
Indicates whether your purger utilizes dynamic runtime measurement.

File

src/Plugin/Purge/Purger/PurgerCapacityDataInterface.php, line 129

Class

PurgerCapacityDataInterface
Describes what capacity tracking expects from purger implementations.

Namespace

Drupal\purge\Plugin\Purge\Purger

Code

public function hasRuntimeMeasurement();