[Orca-users] Re:

Blair Zajac blair at akamai.com
Sun Feb 11 12:09:09 PST 2001


All of the configuration file options are documented in the
docs/orca.* files that are generated when you run make in
either the top level or docs directory.

Here's what this option does:

The filename_compare option is used to sort the found filenames in a 
particular group. This function must be written as though it were 
being passed to the Perl sort() function, which takes the two items to 
compare in the package global $a and $b variables instead of the @_ 
array. 
 
Use of this option has an additional effect on letting Orca know when 
it can flush data to the RRD files. It determines this when it 
compares the previously loaded filename to the filename about to be 
loaded using the filename_compare function. If the result of the 
comparison is greater than 1, then the data is flushed. If the 
comparison is equal to or less than 1, then the data is not 
flushed. Orca uses a value of 1 instead of 0 since there are cases 
when the filenames should still be ordered but not flushed. 
 
For example, the orcallator.cfg file uses the following subroutine for 
filenames of the form "orcallator-2000-02-14": 
 
  sub {  
    my ($ay, $am, $ad) = $a =~ /-(\d{4})-(\d\d)-(\d\d)/;  
    my ($by, $bm, $bd) = $b =~ /-(\d{4})-(\d\d)-(\d\d)/;  
    if (my $c = (( $ay       <=>  $by) ||  
                 ( $am       <=>  $bm) ||  
                 (($ad >> 3) <=> ($bd >> 3)))) {  
      return 2*$c;  
    }  
    $ad <=> $bd;  
  }  
 
When Orca is about to load a new data file it compares the new 
filename with the previous name. Using this function, if the year, or 
month is different, then data gets flushed. If these two are equal but 
the day divided by 8 is different, then the data gets flushed. So 
loading orcallator-2000-02-14 followed by orcallator-2000-02-15 will 
not cause a flush but when orcallator-2000-02-16 is about to be 
loaded, previously loaded data will be flushed. 
 
If the filename_compare option is not used, then the filenames are 
sorted using the Perl <=> operator and data is not flushed until all 
of it is loaded. 


> Mbh wrote:
> 
> What 's the group option "filename_compare" ?
> 
> Regards,
> 
> Mehdi Ben Hassen
> Network Engineer
> Altran Europe: http://www.altran-group.com
> Tel: +32 (0)3 450 36 13
> Gsm: 0476/ 76.95.82
> Email: mehdi.ben_hassen at alcatel.be
> 
>                    Yahoo! Groups Sponsor
> 
>              www.
> 
>



More information about the Orca-users mailing list