You are here

interface StatsTrackerInterface in Purge 8.3

Describes the queue statistics tracker.

Classes implementing this interface provide several numeric counters which represent operational and statistical information related to the queue.

Hierarchy

Expanded class hierarchy of StatsTrackerInterface

All classes that implement StatsTrackerInterface

2 files declare their use of StatsTrackerInterface
QueueCommands.php in modules/purge_drush/src/Commands/QueueCommands.php
QueueSizeDiagnosticCheck.php in src/Plugin/Purge/DiagnosticCheck/QueueSizeDiagnosticCheck.php

File

src/Plugin/Purge/Queue/StatsTrackerInterface.php, line 13

Namespace

Drupal\purge\Plugin\Purge\Queue
View source
interface StatsTrackerInterface extends DestructableInterface, \Iterator, \Countable {

  /**
   * Array index for ::numberOfItems().
   *
   * @var int
   */
  const NUMBER_OF_ITEMS = 0;

  /**
   * Array index for ::totalProcessing().
   *
   * @var int
   */
  const TOTAL_PROCESSING = 1;

  /**
   * Array index for ::totalSucceeded().
   *
   * @var int
   */
  const TOTAL_SUCCEEDED = 2;

  /**
   * Array index for ::totalFailed().
   *
   * @var int
   */
  const TOTAL_FAILED = 3;

  /**
   * Array index for ::totalNotSupported().
   *
   * @var int
   */
  const TOTAL_NOT_SUPPORTED = 4;

  /**
   * The number of items currently in the queue.
   *
   * @return \Drupal\purge\Plugin\Purge\Queue\NumberOfItemsStatistic
   *   The \Drupal\purge\CounterExplainedCounterInterface compliant statistic.
   */
  public function numberOfItems();

  /**
   * Total number of failed queue items.
   *
   * @return \Drupal\purge\Plugin\Purge\Queue\TotalFailedStatistic
   *   The \Drupal\purge\CounterExplainedCounterInterface compliant statistic.
   */
  public function totalFailed();

  /**
   * Total number of multi-step cache invalidations.
   *
   * @return \Drupal\purge\Plugin\Purge\Queue\TotalProcessingStatistic
   *   The \Drupal\purge\CounterExplainedCounterInterface compliant statistic.
   */
  public function totalProcessing();

  /**
   * Total number of succeeded queue items.
   *
   * @return \Drupal\purge\Plugin\Purge\Queue\TotalSucceededStatistic
   *   The \Drupal\purge\CounterExplainedCounterInterface compliant statistic.
   */
  public function totalSucceeded();

  /**
   * Total number of not supported invalidations.
   *
   * @return \Drupal\purge\Plugin\Purge\Queue\TotalNotSupportedStatistic
   *   The \Drupal\purge\CounterExplainedCounterInterface compliant statistic.
   */
  public function totalNotSupported();

  /**
   * Reset the total counters.
   *
   * This is a shorthand for these calls:
   *  - ::totalFailed()->set(0)
   *  - ::totalProcessing()->set(0)
   *  - ::totalSucceeded()->set(0)
   *  - ::totalNotSupported()->set(0)
   */
  public function resetTotals();

  /**
   * Automatically update the total counters for the given invalidations.
   *
   * @param \Drupal\purge\Plugin\Purge\Invalidation\InvalidationInterface[] $invalidations
   *   A non-associative array with invalidation objects regardless of the state
   *   they're in. Their state will determine which counter will be updated.
   */
  public function updateTotals(array $invalidations);

}

Members

Namesort descending Modifiers Type Description Overrides
DestructableInterface::destruct public function Performs destruct operations. 6
StatsTrackerInterface::numberOfItems public function The number of items currently in the queue. 1
StatsTrackerInterface::NUMBER_OF_ITEMS constant Array index for ::numberOfItems().
StatsTrackerInterface::resetTotals public function Reset the total counters. 1
StatsTrackerInterface::totalFailed public function Total number of failed queue items. 1
StatsTrackerInterface::totalNotSupported public function Total number of not supported invalidations. 1
StatsTrackerInterface::totalProcessing public function Total number of multi-step cache invalidations. 1
StatsTrackerInterface::totalSucceeded public function Total number of succeeded queue items. 1
StatsTrackerInterface::TOTAL_FAILED constant Array index for ::totalFailed().
StatsTrackerInterface::TOTAL_NOT_SUPPORTED constant Array index for ::totalNotSupported().
StatsTrackerInterface::TOTAL_PROCESSING constant Array index for ::totalProcessing().
StatsTrackerInterface::TOTAL_SUCCEEDED constant Array index for ::totalSucceeded().
StatsTrackerInterface::updateTotals public function Automatically update the total counters for the given invalidations. 1