Skip to content

Commit e3b6a62

Browse files
author
Marcin Przepiorowski
committed
Merge branch 'issue#90_logicreverse' into develop
2 parents bca5959 + 8b231cd commit e3b6a62

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

bin/dx_get_analytics.pl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
'dever=s' => \(my $dever),
5959
'interval|i=s' => \($resolution),
6060
'version' => \(my $print_version),
61-
'skipinvalid' => \(my $skipinvalid),
61+
'stoponinvalid' => \(my $stoponinvalid),
6262
'nohead' => \(my $nohead),
6363
'configfile|c=s' => \(my $config_file)
6464
) or pod2usage(-verbose => 1, -input=>\*DATA);
@@ -153,7 +153,7 @@
153153
my $arguments = "&resolution=$resolution&startTime=$st_timestamp";
154154
my $endTime = $et_timestamp ? "&endTime=$et_timestamp" : "";
155155
$arguments = $arguments . $endTime;
156-
$ret = $ret + $analytic_list->get_perf($type, $outdir, $arguments, $allowedres{$resolution}, $format, $skipinvalid );
156+
$ret = $ret + $analytic_list->get_perf($type, $outdir, $arguments, $allowedres{$resolution}, $format, $stoponinvalid );
157157

158158
}
159159

@@ -178,7 +178,7 @@ =head1 SYNOPSIS
178178
[-i interval ]
179179
[-st <start_time> ]
180180
[-et <end_time> ]
181-
[-skipinvalid ]
181+
[-stoponinvalid ]
182182
-format csv|json
183183
-debug
184184
@@ -233,10 +233,10 @@ =head1 OPTIONS
233233
234234
=over 4
235235
236-
=item B<-skipinvalid>
237-
Skip broken or empty analytic output and contiune with other.
238-
Return code will be not 0 if there were any skipped analytics.
239-
Default is stop execution on first broken or empty analytic.
236+
=item B<-stoponinvalid>
237+
Stop on the invalid analytic and exit processing.
238+
Invalid analytics are skipped by default. Return code will be not 0
239+
if there were any skipped analytics.
240240
241241
=item B<-format>
242242
Display output in csv or json format

lib/Analytics.pm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ sub get_perf {
145145
my $arguments = shift;
146146
my $resolution = shift;
147147
my $format = shift;
148-
my $skipinvalid = shift;
148+
my $stoponinvalid = shift;
149149

150150
logger($self->{_debug}, "Entering Analytics::get_perf",1);
151151

@@ -192,24 +192,24 @@ sub get_perf {
192192
if ($ret) {
193193
if ($ret eq 1) {
194194
print "Timeout during gathering data for " . $analytic->getName() . "\n";
195-
if (defined($skipinvalid)) {
196-
$returncode = $returncode + 1;
197-
} else {
195+
if (defined($stoponinvalid)) {
198196
return 1;
197+
} else {
198+
$returncode = $returncode + 1;
199199
}
200200
} elsif ($ret eq 2) {
201201
print "No data returned for analytics " . $analytic->getName() . ". Consider restarting collector\n";
202-
if (defined($skipinvalid)) {
203-
$returncode = $returncode + 1;
204-
} else {
202+
if (defined($stoponinvalid)) {
205203
return 2;
204+
} else {
205+
$returncode = $returncode + 1;
206206
}
207207
} else {
208208
print "Unknown error gathering a data for " . $analytic->getName() . "\n";
209-
if (defined($skipinvalid)) {
210-
$returncode = $returncode + 1;
211-
} else {
209+
if (defined($stoponinvalid)) {
212210
return 3;
211+
} else {
212+
$returncode = $returncode + 1;
213213
}
214214
}
215215
} else {

0 commit comments

Comments
 (0)