mirror of https://github.com/mikaku/Monitorix.git
added the max() function
This commit is contained in:
parent
e815393761
commit
62ba877427
|
@ -23,7 +23,7 @@ package Monitorix;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Exporter 'import';
|
use Exporter 'import';
|
||||||
our @EXPORT = qw(logger trim get_nvidia_data flush_accounting_rules);
|
our @EXPORT = qw(logger trim max get_nvidia_data flush_accounting_rules);
|
||||||
|
|
||||||
sub logger {
|
sub logger {
|
||||||
my ($msg) = @_;
|
my ($msg) = @_;
|
||||||
|
@ -42,6 +42,14 @@ sub trim {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub max {
|
||||||
|
my ($max, @args) = @_;
|
||||||
|
foreach (@args) {
|
||||||
|
$max = $_ if $_ > $max;
|
||||||
|
}
|
||||||
|
return $max;
|
||||||
|
}
|
||||||
|
|
||||||
sub get_nvidia_data {
|
sub get_nvidia_data {
|
||||||
my ($gpu) = @_;
|
my ($gpu) = @_;
|
||||||
my $total = 0;
|
my $total = 0;
|
||||||
|
|
Loading…
Reference in New Issue