Add refresh_interval option in minutes to du.pm

This commit is contained in:
Andreas Bachlechner 2021-09-28 13:12:35 +02:00
parent 5a9e968144
commit a755957380
2 changed files with 9 additions and 1 deletions

View File

@ -140,6 +140,14 @@ sub du_update {
my $str;
my $rrdata = "N";
my $refresh_interval = ($config->{du}->{refresh_interval} || 0);
if($refresh_interval > 0) {
# If desired refreshed only every refresh_interval minutes.
# This logic will refresh atleast once a day.
my (undef, $min, $hour) = localtime(time);
return if(($min + 60 * $hour) % $refresh_interval);
}
my $e = 0;
while($e < scalar(my @dl = split(',', $du->{list}))) {
my $type;

View File

@ -1637,7 +1637,7 @@ This is a comma-separated list of pool names. The number of pool names defined h
.SS Directory usage statistics (du.pm)
This graph is able to monitor the usage of an unlimited number of directories.
.P
IMPORTANT NOTE: The \fIdu\fP command makes intensive disk I/O access that might slow down the whole system. Moreover, continued executions of this command will affect the buffer cache mechanism and this will also increase the system response time.
IMPORTANT NOTE: The \fIdu\fP command makes intensive disk I/O access that might slow down the whole system. Moreover, continued executions of this command will affect the buffer cache mechanism and this will also increase the system response time. To reduce executions \fIrefresh_interval\fP can be specified in minutes (Use 0 for default refresh interval).
.P
.BI list
.RS