You are here

public function RuntimeMeasurement::getSafeTimeHintValue in Purge 8.3

Return a value safe for time hints, between 0.1 and 10.00.

Parameters

float $value: The measurement value.

Return value

float The same value or 0.1 or 10.0 when it exceeded either boundary.

Overrides RuntimeMeasurementInterface::getSafeTimeHintValue

See also

\Drupal\purge\Plugin\Purge\Purger\PurgerCapacityDataInterface::getTimeHint()

1 call to RuntimeMeasurement::getSafeTimeHintValue()
RuntimeMeasurement::stop in src/Plugin/Purge/Purger/RuntimeMeasurement.php
Stop measuring execution time and store if necessary.

File

src/Plugin/Purge/Purger/RuntimeMeasurement.php, line 23

Class

RuntimeMeasurement
Provides a execution time measurer for invalidation processing.

Namespace

Drupal\purge\Plugin\Purge\Purger

Code

public function getSafeTimeHintValue($value) {
  if ($value < 0.1) {
    return 0.1;
  }
  elseif ($value > 10.0) {
    return 10.0;
  }
  return $value;
}