App-AlgorithmBackoffUtils

 view release on metacpan or  search on metacpan

script/show-backoff-delays  view on Meta::CPAN

    read_config => 0,
    read_env => 0,
);

$cmdline->run;

# ABSTRACT: Show backoff delays
# PODNAME: show-backoff-delays

__END__

=pod

=encoding UTF-8

=head1 NAME

show-backoff-delays - Show backoff delays

=head1 VERSION

This document describes version 0.005 of show-backoff-delays (from Perl distribution App-AlgorithmBackoffUtils), released on 2020-10-20.

=head1 SYNOPSIS

Usage:

 % show-backoff-delays [-a=s] [--algorithm=s] [--consider-actual-delay]
     [--debug] [--delay-increment-on-failure=s]
     [--delay-increment-on-success=s] [--delay-multiple-on-failure=s]
     [--delay-multiple-on-success=s] [--delay-on-success=s] [--delay=s]
     [--dry-run] [--exponent-base=s] [--format=name] [--initial-delay1=s]
     [--initial-delay2=s] [--initial-delay=s] [--jitter-factor=s] [--json]
     [--log-level=level] [--log=s+] [--logs-json=s]
     [--max-actual-duration=s] [--max-attempts=s] [--max-delay=s]
     [--min-delay=s] [--(no)naked-res] [--no-consider-actual-delay]
     [--noconsider-actual-delay] [--page-result[=program]] [--quiet]
     [--trace] [--verbose] <log> ...

=head1 OPTIONS

C<*> marks required options.

=head2 Main options

=over

=item B<--algorithm>=I<s>*, B<-a>

Backoff algorithm.

Valid values:

 ["Constant","Exponential","Fibonacci","LILD","LIMD","MILD","MIMD"]

=item B<--log>=I<s@>*

List of failures or successes.

A list of 0's (to signify failure) or 1's (to signify success). Each
failure/success can be followed by `:TIMESTAMP` (unix epoch) or `:+SECS` (number
of seconds after the previous log), or the current timestamp will be assumed.
Examples:

    0 0 0 0 0 0 0 0 0 0 1 1 1 1 1

(10 failures followed by 5 successes).

    0 0:+2 0:+4 0:+6 1

(4 failures, 2 seconds apart, followed by immediate success.)


Can be specified multiple times.

=item B<--logs-json>=I<s>

List of failures or successes (JSON-encoded).

See C<--log>.

=back

=head2 Common to all algorithms options

=over

=item B<--consider-actual-delay>

Whether to consider actual delay.

If set to true, will take into account the actual delay (timestamp difference).
For example, when using the Constant strategy of delay=2, you log failure()
again right after the previous failure() (i.e. specify the same timestamp).
failure() will then return ~2+2 = 4 seconds. On the other hand, if you waited 2
seconds before calling failure() again (i.e. specify the timestamp that is 2
seconds larger than the previous timestamp), failure() will return 2 seconds.
And if you waited 4 seconds or more, failure() will return 0.


=item B<--jitter-factor>=I<s>

How much to add randomness.

If you set this to a value larger than 0, the actual delay will be between a
random number between original_delay * (1-jitter_factor) and original_delay *
(1+jitter_factor). Jitters are usually added to avoid so-called "thundering
herd" problem.

The jitter will be applied to delay on failure as well as on success.


=item B<--max-actual-duration>=I<s>

Maximum number of seconds for all of the attempts (0 means unlimited).

Default value:

 0

If set to a positive number, will limit the number of seconds for all of the



( run in 0.563 second using v1.01-cache-2.11-cpan-39bf76dae61 )