mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user