Debian Codegraph @

lib/App/Yath/Options/Collector.pm

raw
1 package App::Yath::Options::Collector;
2 use strict;
3 use warnings;
4
5 our $VERSION = '1.000179';
6
7 use App::Yath::Options;
8
9 option_group {prefix => 'collector', category => "Collector Options"} => sub {
10 option max_open_jobs => (
11 type => 's',
12 description => 'Maximum number of jobs a collector can process at a time, if more jobs are pending their output will be delayed until the earlier jobs have been processed. (Default: double the -j value)',
13 long_examples => [' 18'],
14 short_examples => [' 18'],
15 );
16
17 option max_poll_events => (
18 type => 's',
19 description => 'Maximum number of events to poll from a job before jumping to the next job. (Default: 1000)',
20 default => 1000,
21 long_examples => [' 1000'],
22 short_examples => [' 1000'],
23 );
24
25 post \&collector_post;
26 };
27
28 sub collector_post {
29 my %params = @_;
30 my $settings = $params{settings};
31
32 unless ($settings->collector->max_open_jobs) {
33 my $j = $settings->runner->job_count // 1;
34 my $max_open = 2 * $j;
35 $settings->collector->field(max_open_jobs => $max_open);
36 }
37 }
38
39
40 1;
41
42 __END__
43
44
45 =pod
46
47 =encoding UTF-8
48
49 =head1 NAME
50
51 App::Yath::Options::Collector - collector options for Yath.
52
53 =head1 DESCRIPTION
54
55 This is where the command line options for the collector are defined.
56
57 =head1 PROVIDED OPTIONS
58
59 =head2 COMMAND OPTIONS
60
61 =head3 Collector Options
62
63 =over 4
64
65 =item --max-open-jobs 18
66
67 =item --no-max-open-jobs
68
69 Maximum number of jobs a collector can process at a time, if more jobs are pending their output will be delayed until the earlier jobs have been processed. (Default: double the -j value)
70
71
72 =item --max-poll-events 1000
73
74 =item --no-max-poll-events
75
76 Maximum number of events to poll from a job before jumping to the next job. (Default: 1000)
77
78
79 =back
80
81 =head1 SOURCE
82
83 The source code repository for Test2-Harness can be found at
84 F<http://github.com/Test-More/Test2-Harness/>.
85
86 =head1 MAINTAINERS
87
88 =over 4
89
90 =item Chad Granum E<lt>[email protected]<gt>
91
92 =back
93
94 =head1 AUTHORS
95
96 =over 4
97
98 =item Chad Granum E<lt>[email protected]<gt>
99
100 =back
101
102 =head1 COPYRIGHT
103
104 Copyright 2020 Chad Granum E<lt>[email protected]<gt>.
105
106 This program is free software; you can redistribute it and/or
107 modify it under the same terms as Perl itself.
108
109 See F<http://dev.perl.org/licenses/>
110
111 =cut