Re: [Nfsen-discuss] passing named parameters
Netflow visualisation and investigation tool
Brought to you by:
phaag
|
From: Maurizio M. <mau...@da...> - 2006-08-17 08:51:48
|
Kiss Gabor [Bitman] wrote:
>Dear Peter,
>
>I suggest to change the parameter passing of library routines like
>NfSenRRD::SetupRRD.
>
>Now caller have set up several trivial params in fixed order:
> NfSenRRD::SetupRRD("$NfConf::PROFILESTATDIR/live", $new_source,
> $tstart - 300, 0);
>
>Now I plan to add Holt-Winters forecasting
>
Hi Gabor,
could you recall me how this forecast works, and what are you planning
to use it for?
Thanks,
Maurizio
> into RRDs and probably
>I'd will have other developments. This may make some parameter lists
>long and messy therefore easy to get it wrong.
>
>Hash-line named parameters are more readable:
>
> NfSenRRD::SetupRRD(
> path => "$NfConf::PROFILESTATDIR/live",
> db => $new_source,
> start => $tstart - 300,
># No 'force => 0' required because this is the default value
> hw => 1, # add Holt-Winters
> alpha => 0.4,
># Other optional parameters here
> );
>
>Then function's head could look like this:
>
>sub SetupRRD {
> my %args = @_;
> my $path = $args{path};
> my $db = $args{db};
> my $start = $args{start};
> my $hw = $args{hw}; # undef (=false) if missing
> my $force = $args{force}; # undef (=false) if missing
> my $alpha = $args{alpha} || 0.3;
> my $beta = $args{beta} || 0.002;
> my $gamma = $args{gamma} || 0.05;
>
>What is your opinion?
>
>Regards
>
>Gabor
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Nfsen-discuss mailing list
>Nfs...@li...
>https://lists.sourceforge.net/lists/listinfo/nfsen-discuss
>
>
--
______________________________________________________________________
Maurizio Molina
Network Engineer
DANTE - www.dante.net
Tel: +44 (0)1223 371 300
Fax: +44 (0)1223 371 371
Email: mau...@da...
PGP Key ID: 3FF58D51
City House, 126-130 Hills Road
Cambridge CB2 1PQ
UK
_____________________________________________________________________
|