You are here

class McrouterStatsObject in Memcache API and Integration 8.2

Class MemcacheStats.

@package Drupal\memcache_admin\Stats

Hierarchy

Expanded class hierarchy of McrouterStatsObject

1 file declares its use of McrouterStatsObject
McrouterStatsSubscriber.php in memcache_admin/src/EventSubscriber/McrouterStatsSubscriber.php

File

memcache_admin/src/Stats/McrouterStatsObject.php, line 12

Namespace

Drupal\memcache_admin\Stats
View source
class McrouterStatsObject extends MemcacheStatsObject implements MemcacheStatsInterface {
  use StringTranslationTrait;

  /**
   * @var array $stats
   */
  protected $stats;
  public function __construct(array $raw_stats) {
    $this->stats = $raw_stats;
  }

  /**
   * @inheritDoc
   */
  public function getExtension() : string {
    return isset($this->stats['version']) ?? self::NA;
  }

  /**
   * @inheritDoc
   */
  public function getServerTime() : string {
    return isset($this->stats['time']) ? \Drupal::service('date.formatter')
      ->format($this->stats['time']) : self::NA;
  }

  /**
   * Statistics report: format total and open connections.
   */
  public function getConnections() {
    return self::NA;
  }

  /**
   * @inheritDoc
   */
  public function getCurrentConnections() : string {
    return self::NA;
  }

  /**
   * @inheritDoc
   */
  public function getTotalConnections() : string {
    return self::NA;
  }

  /**
   * Statistics report: calculate # of get cmds, broken down by hits and misses.
   */
  public function getGets() : string {
    return self::NA;
  }

  /**
   * @inheritDoc
   */
  public function getCounters() : string {
    return self::NA;
  }

  /**
   * @inheritDoc
   */
  public function getTransferred() : string {
    return self::NA;
  }

  /**
   * @inheritDoc
   */
  public function getConnectionAvg() : string {
    return self::NA;
  }

  /**
   * @inheritDoc
   */
  public function getMemory() : string {
    return self::NA;
  }

  /**
   * @inheritDoc
   */
  public function getEvictions() : string {
    return isset($this->stats['evictions']) ? number_format($this->stats['evictions']) : self::NA;
  }

  /**
   * @inheritDoc
   */
  public function setRaw(array $raw_data) {
    $this->stats = $raw_data;
  }

  /**
   * @inheritDoc
   */
  public function getRaw() : array {
    return $this->stats;
  }

  /**
   * @inheritDoc
   */
  public function getVersion() : string {
    return isset($this->stats['version']) ? (string) $this->stats['version'] : self::NA;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
McrouterStatsObject::$stats protected property Overrides MemcacheStatsObject::$stats
McrouterStatsObject::getConnectionAvg public function @inheritDoc Overrides MemcacheStatsObject::getConnectionAvg
McrouterStatsObject::getConnections public function Statistics report: format total and open connections. Overrides MemcacheStatsObject::getConnections
McrouterStatsObject::getCounters public function @inheritDoc Overrides MemcacheStatsObject::getCounters
McrouterStatsObject::getCurrentConnections public function @inheritDoc Overrides MemcacheStatsObject::getCurrentConnections
McrouterStatsObject::getEvictions public function @inheritDoc Overrides MemcacheStatsObject::getEvictions
McrouterStatsObject::getExtension public function @inheritDoc Overrides MemcacheStatsObject::getExtension
McrouterStatsObject::getGets public function Statistics report: calculate # of get cmds, broken down by hits and misses. Overrides MemcacheStatsObject::getGets
McrouterStatsObject::getMemory public function @inheritDoc Overrides MemcacheStatsObject::getMemory
McrouterStatsObject::getRaw public function @inheritDoc Overrides MemcacheStatsObject::getRaw
McrouterStatsObject::getServerTime public function @inheritDoc Overrides MemcacheStatsObject::getServerTime
McrouterStatsObject::getTotalConnections public function @inheritDoc Overrides MemcacheStatsObject::getTotalConnections
McrouterStatsObject::getTransferred public function @inheritDoc Overrides MemcacheStatsObject::getTransferred
McrouterStatsObject::getVersion public function @inheritDoc Overrides MemcacheStatsObject::getVersion
McrouterStatsObject::setRaw public function @inheritDoc Overrides MemcacheStatsObject::setRaw
McrouterStatsObject::__construct public function Overrides MemcacheStatsObject::__construct
MemcacheStatsObject::getSets public function Statistics report: calculate # of set cmds and total cmds. Overrides MemcacheStatsInterface::getSets
MemcacheStatsObject::getUptime public function @inheritDoc Overrides MemcacheStatsInterface::getUptime
MemcacheStatsObject::NA constant Stat Not Available
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.