diff options
author | Simon Rettberg | 2022-09-12 14:32:41 +0200 |
---|---|---|
committer | Simon Rettberg | 2022-09-12 14:32:41 +0200 |
commit | de769a9c2d8589336c7e0e16682450c2b787ca96 (patch) | |
tree | 80018dded7244d30872be2eaeac54e415fe1ba60 /modules-available/statistics/inc | |
parent | [inc/Property] Fix warning about type conversion (diff) | |
download | slx-admin-de769a9c2d8589336c7e0e16682450c2b787ca96.tar.gz slx-admin-de769a9c2d8589336c7e0e16682450c2b787ca96.tar.xz slx-admin-de769a9c2d8589336c7e0e16682450c2b787ca96.zip |
[statistics] Add NIC speed filter/display
Diffstat (limited to 'modules-available/statistics/inc')
-rw-r--r-- | modules-available/statistics/inc/statisticsfilter.inc.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules-available/statistics/inc/statisticsfilter.inc.php b/modules-available/statistics/inc/statisticsfilter.inc.php index c83d9542..c54c56d1 100644 --- a/modules-available/statistics/inc/statisticsfilter.inc.php +++ b/modules-available/statistics/inc/statisticsfilter.inc.php @@ -276,6 +276,7 @@ abstract class StatisticsFilter 'live_id45free' => new SimpleNotZeroStatisticsFilter('live_id45free', self::OP_ORDINAL, 'MiB'), 'standbycrash' => new StandbyCrashStatisticsFilter(), 'pcidev' => new PciDeviceStatisticsFilter(), + 'nicpseed' => new NicSpeedStatisticsFilter(), 'anydev' => new AnyHardwarePropStatisticsFilter(), ]; if (Module::isAvailable('locations')) { @@ -709,6 +710,26 @@ class PciDeviceStatisticsFilter extends StatisticsFilter } +class NicSpeedStatisticsFilter extends StatisticsFilter +{ + + public function __construct() + { + parent::__construct(null, StatisticsFilter::OP_ORDINAL); + } + + public function whereClause(string $operator, $argument, array &$args, array &$joins): string + { + $shw = StatisticsFilter::addHardwareJoin($args, $joins, HardwareInfo::MAINBOARD); + $_ = []; + $c = new HardwareQueryColumn(false, 'nic-speed'); + $c->addCondition($operator, $argument); + $c->generate($joins, $_, $args, [], $shw); + return '1'; + } + +} + class AnyHardwarePropStatisticsFilter extends StatisticsFilter { |