diff --git a/lib/Monitorix.pm b/lib/Monitorix.pm index d2a1b01..d60c3ca 100644 --- a/lib/Monitorix.pm +++ b/lib/Monitorix.pm @@ -23,7 +23,7 @@ package Monitorix; use strict; use warnings; 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 { my ($msg) = @_; @@ -42,6 +42,14 @@ sub trim { } } +sub max { + my ($max, @args) = @_; + foreach (@args) { + $max = $_ if $_ > $max; + } + return $max; +} + sub get_nvidia_data { my ($gpu) = @_; my $total = 0;