Changeset 3360

Show
Ignore:
Timestamp:
02/14/10 14:48:02 (2 years ago)
Author:
steve.schnepp
Message:

- completes r3357
- adds an "aligned" suboption to update_rate. Enables to align RRD updates to granularity. (was "discrete" at first)
- also use the "standard" units for update_rate

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • people/snide/pre_1.5/master/lib/Munin/Master/UpdateWorker.pm

    r3357 r3360  
    8989                # Check if this plugin has to be updated 
    9090                my $update_rate = get_global_service_value(\%service_config, $plugin, "update_rate", 0);  
    91                 my ($update_rate_in_seconds, $is_update_discrete) = parse_update_rate($update_rate); 
     91                my ($update_rate_in_seconds, $is_update_aligned) = parse_update_rate($update_rate); 
    9292                # default is 0 sec : always update when asked 
    9393                DEBUG "[DEBUG] update_rate $update_rate_in_seconds for $plugin on $nodedesignation"; 
     
    103103                } 
    104104 
    105                 # If update_rate is discrete, round the "when" for granularity 
    106                 if ($is_update_discrete) { 
     105                # If update_rate is aligned, round the "when" for alignement 
     106                if ($is_update_aligned) { 
    107107                        foreach my $service (keys %service_data) { 
    108108                                my $current_service_data = $service_data{$service}; 
     
    227227sub parse_update_rate { 
    228228        my ($update_rate_config) = @_; 
    229         #$update_rate_config = $config->_trim($update_rate_config); 
    230  
    231         my ($is_update_discrete, $update_rate_in_sec); 
    232         if ($update_rate_config =~ m/(\d+[a-z]?) (discrete)?/) { 
     229 
     230        my ($is_update_aligned, $update_rate_in_sec); 
     231        if ($update_rate_config =~ m/(\d+[a-z]?) (aligned)?/) { 
    233232                $update_rate_in_sec = to_sec($1); 
    234                 $is_update_discrete = $2; 
     233                $is_update_aligned = $2; 
    235234        } else { 
    236235                return (0, 0); 
    237236        } 
    238237 
    239         return ($update_rate_in_sec, $is_update_discrete); 
     238        return ($update_rate_in_sec, $is_update_aligned); 
    240239} 
    241240