From 29b13a7751b0f2bee149c6c324aa8dce8afd3885 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Monin?= Date: Sat, 25 Apr 2015 12:02:44 +0200 Subject: [PATCH] rrdtune: fix options documentation and parsing * Document all the short options. * Document step option (although detailled documentation is missing) * Add short options '-s', '-S', '-t' and '-D' to getopt. * Add missing options to rrdtool help. --- doc/rrdtune.pod | 51 ++++++++++++++++++++++++++++--------------------- src/rrd_tool.c | 26 ++++++++++++++++--------- src/rrd_tune.c | 4 ++-- 3 files changed, 48 insertions(+), 33 deletions(-) diff --git a/doc/rrdtune.pod b/doc/rrdtune.pod index 71d70469..d6aa6373 100644 --- a/doc/rrdtune.pod +++ b/doc/rrdtune.pod @@ -10,17 +10,18 @@ S<[B<--minimum>|B<-i> I:I]> S<[B<--maximum>|B<-a> I:I]> S<[B<--data-source-type>|B<-d> I:I]> S<[B<--data-source-rename>|B<-r> I:I]> -S<[B<--deltapos> I]> -S<[B<--deltaneg> I]> -S<[B<--failure-threshold> I]> -S<[B<--window-length> I]> -S<[B<--alpha> I]> -S<[B<--beta> I]> -S<[B<--gamma> I]> -S<[B<--gamma-deviation> I]> -S<[B<--smoothing-window> I]> -S<[B<--smoothing-window-deviation> I]> -S<[B<--aberrant-reset> I]> +S<[B<--deltapos>|B<-p> I]> +S<[B<--deltaneg>|B<-n> I]> +S<[B<--failure-threshold>|B<-f> I]> +S<[B<--window-length>|B<-w> I]> +S<[B<--alpha>|B<-x> I]> +S<[B<--beta>|B<-y> I]> +S<[B<--gamma>|B<-z> I]> +S<[B<--gamma-deviation>|B<-v> I]> +S<[B<--smoothing-window>|B<-s> I]> +S<[B<--smoothing-window-deviation>|B<-S> I]> +S<[B<--aberrant-reset>|B<-b> I]> +S<[B<--step>|B<-t> I]> S<[B<--daemon>|B<-D> I
]> S<[BI]> S<[BI]> @@ -82,7 +83,7 @@ alter the type B of a data source. rename a data source. -=item S I> +=item S|B<-p> I> Alter the deviation scaling factor for the upper bound of the confidence band used internally to calculate violations for the @@ -92,14 +93,14 @@ CDEF argument to generate a graph with confidence bounds. The graph scale factor need not to agree with the value used internally by the FAILURES B. -=item S I> +=item S|B<-n> I> Alter the deviation scaling factor for the lower bound of the confidence band used internally to calculate violations for the FAILURES B. The default value is 2. As with B<--deltapos>, this argument is unrelated to the scale factor chosen when graphing confidence bounds. -=item S I> +=item S|B<-f> I> Alter the number of confidence bound violations that constitute a failure for purposes of the FAILURES B. This must be an integer less than or equal to @@ -107,44 +108,44 @@ the window length of the FAILURES B. This restriction is not verified by the tune option, so one can reset failure-threshold and window-length simultaneously. Setting this option will reset the count of violations to 0. -=item S I> +=item S|B<-w> I> Alter the number of time points in the temporal window for determining failures. This must be an integer greater than or equal to the window length of the FAILURES B and less than or equal to 28. Setting this option will reset the count of violations to 0. -=item S I> +=item S|B<-x> I> Alter the intercept adaptation parameter for the Holt-Winters forecasting algorithm. This parameter must be between 0 and 1. -=item S I> +=item S|B<-y> I> Alter the slope adaptation parameter for the Holt-Winters forecasting algorithm. This parameter must be between 0 and 1. -=item S I> +=item S|B<-z> I> Alter the seasonal coefficient adaptation parameter for the SEASONAL B. This parameter must be between 0 and 1. -=item S I> +=item S|B<-v> I> Alter the seasonal deviation adaptation parameter for the DEVSEASONAL B. This parameter must be between 0 and 1. -=item S I> +=item S|B<-s> I> Alter the size of the smoothing window for the SEASONAL B. This must be between 0 and 1. -=item S I> +=item S|B<-S> I> Alter the size of the smoothing window for the DEVSEASONAL B. This must be between 0 and 1. -=item S I> +=item S|B<-b> I> This option causes the aberrant behavior detection algorithm to reset for the specified data source; that is, forget all it is has learnt so far. @@ -172,6 +173,12 @@ data source. Use of this tuning option is advised when the behavior of the data source time series changes in a drastic and permanent manner. +=item B<--step>|B<-t> I + +Changes the step size of the RRD to newstep. + +TODO: add proper documentation + =item B<--daemon>|B<-D> I
B: Because the B<-d> (small letter 'd') option was already taken, this diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 6a54c0e1..6e4fa60f 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -201,17 +201,25 @@ void PrintUsage( "\t\t[--data-source-type|-d ds-name:DST]\n" "\t\t[--data-source-rename|-r old-name:new-name]\n" "\t\t[--minimum|-i ds-name:min] [--maximum|-a ds-name:max]\n" - "\t\t[--deltapos scale-value] [--deltaneg scale-value]\n" - "\t\t[--failure-threshold integer]\n" - "\t\t[--window-length integer]\n" - "\t\t[--alpha adaptation-parameter]\n"); + "\t\t[--deltapos|-p scale-value] [--deltaneg|-n scale-value]\n" + "\t\t[--failure-threshold|-f integer]\n" + "\t\t[--window-length|-w integer]\n" + "\t\t[--alpha|-x adaptation-parameter]\n"); const char *help_tune2 = - N_("\t\t[--beta adaptation-parameter]\n" - "\t\t[--gamma adaptation-parameter]\n" - "\t\t[--gamma-deviation adaptation-parameter]\n" - "\t\t[--aberrant-reset ds-name]\n"); + N_("\t\t[--beta|-y adaptation-parameter]\n" + "\t\t[--gamma|-z adaptation-parameter]\n" + "\t\t[--gamma-deviation|-v adaptation-parameter]\n" + "\t\t[--smoothing-window|-s fraction-of-season]\n" + "\t\t[--smoothing-window-deviation|-S fraction-of-season]\n" + "\t\t[--aberrant-reset|-b ds-name]\n"); const char *help_tune3 = - N_("\t\t???"); // FIXME + N_("\t\t[--step|-t newstep]\n" + "\t\t[--daemon|-D address]\n" + "\t\t[DEL:ds-name]\n" + "\t\t[DS:ds-spec]\n" + "\t\t[DELRRA:index]\n" + "\t\t[RRA:rra-spec]\n" + "\t\t[RRA#index:[+-=]number]\n"); const char *help_resize = N_ (" * resize - alter the length of one of the RRAs in an RRD\n\n" diff --git a/src/rrd_tune.c b/src/rrd_tune.c index 4838d4c7..c743d37a 100644 --- a/src/rrd_tune.c +++ b/src/rrd_tune.c @@ -124,7 +124,7 @@ int rrd_tune( while (1) { int option_index = 0; - int opt = getopt_long(argc, argv, "h:i:a:d:r:p:n:w:f:x:y:z:v:b:", + int opt = getopt_long(argc, argv, "h:i:a:d:r:p:n:w:f:x:y:z:v:s:S:b:t:D:", long_options, &option_index); if (opt == EOF) break; @@ -187,7 +187,7 @@ int rrd_tune( int opt; unsigned int strtod_ret_val; - opt = getopt_long(argc, argv, "h:i:a:d:r:p:n:w:f:x:y:z:v:b:", + opt = getopt_long(argc, argv, "h:i:a:d:r:p:n:w:f:x:y:z:v:s:S:b:t:D:", long_options, &option_index); if (opt == EOF) break; -- 2.47.2