hydra-send-stats: add a --once option for testing

[?]
Mar 20, 2021, 1:12 PM
TPL3BSXGOXPJ2CGNBO7S3XBQMKQFPNVML2EUCQD7ATVAOWYJ5TMAC

Dependencies

  • [2] BZSJO2RM hydra-send-stats: Keep track of the number of machines
  • [3] DNOLOMX7 hydra-send-stats: add a failing test asserting it can run
  • [*] DODOGD7M Send queue runner stats to statsd
  • [*] LE4VZIY5 More stats

Change contents

  • edit in src/script/hydra-send-stats at line 9
    [5.521]
    [5.521]
    use Getopt::Long qw(:config gnu_getopt);
  • edit in src/script/hydra-send-stats at line 67
    [2.189]
    [5.1831]
    }
    sub showHelp {
    print <<EOF;
    Usage: $0 [--once]
    Send stats to statsd. The --once flag can be used to send one round
    of stats and then exit.
    Example:
    \$ $0 --once
    EOF
    exit 0;
  • edit in src/script/hydra-send-stats at line 82
    [5.1833]
    [5.1833]
    my $once = 0;
    GetOptions("once" => \$once,
    "help" => sub { showHelp() }
    ) or exit 1;
  • edit in src/script/hydra-send-stats at line 102
    [6.1273]
    [5.1911]
    if ($once) {
    last;
    }
  • replacement in t/scripts/hydra-send-stats.t at line 15
    [3.495][3.495:572]()
    my ($res, $stdout, $stderr) = captureStdoutStderr(60, ("hydra-send-stats"));
    [3.495]
    [3.572]
    my ($res, $stdout, $stderr) = captureStdoutStderr(60, ("hydra-send-stats", "--once"));