Change mempools summary graph to show values v2 (#12355)

* Change mempools summary graph to show values
put swap on the negative axis
fix swap classification

* fix whitespace

* fix incorrect class
fix rrd rename logic

* Style

* missed one

* observe with the correct class
This commit is contained in:
Tony Murray
2020-11-25 10:31:24 -06:00
committed by GitHub
parent 23e8544913
commit 5d3e06ee69
37 changed files with 136 additions and 62 deletions

View File

@@ -95,10 +95,11 @@ class Mempool extends DeviceRelatedModel implements Keyable
/**
* Set the mempool class. If no class is given, try to detect it from available data.
*
* @param null $class
* @param string $class
* @param string $default
* @return \App\Models\Mempool
*/
public function setClass($class = null)
public function setClass($class = null, $default = 'system')
{
if ($class) {
$this->mempool_class = $class;
@@ -124,7 +125,14 @@ class Mempool extends DeviceRelatedModel implements Keyable
return $this;
}
}
$this->mempool_class = 'system'; // just call everything else system
if ($default == 'virtual' && Str::contains($this->mempool_descr, ['/dev/'])) {
$this->mempool_class = 'swap';
return $this;
}
$this->mempool_class = $default;
return $this;
}