McrouterStatsObject.php in Memcache API and Integration 8.2
File
memcache_admin/src/Stats/McrouterStatsObject.php
View source
<?php
namespace Drupal\memcache_admin\Stats;
use Drupal\Core\StringTranslation\StringTranslationTrait;
class McrouterStatsObject extends MemcacheStatsObject implements MemcacheStatsInterface {
use StringTranslationTrait;
protected $stats;
public function __construct(array $raw_stats) {
$this->stats = $raw_stats;
}
public function getExtension() : string {
return isset($this->stats['version']) ?? self::NA;
}
public function getServerTime() : string {
return isset($this->stats['time']) ? \Drupal::service('date.formatter')
->format($this->stats['time']) : self::NA;
}
public function getConnections() {
return self::NA;
}
public function getCurrentConnections() : string {
return self::NA;
}
public function getTotalConnections() : string {
return self::NA;
}
public function getGets() : string {
return self::NA;
}
public function getCounters() : string {
return self::NA;
}
public function getTransferred() : string {
return self::NA;
}
public function getConnectionAvg() : string {
return self::NA;
}
public function getMemory() : string {
return self::NA;
}
public function getEvictions() : string {
return isset($this->stats['evictions']) ? number_format($this->stats['evictions']) : self::NA;
}
public function setRaw(array $raw_data) {
$this->stats = $raw_data;
}
public function getRaw() : array {
return $this->stats;
}
public function getVersion() : string {
return isset($this->stats['version']) ? (string) $this->stats['version'] : self::NA;
}
}