Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-gh-mirror
ensembl-hive
Commits
9f8199c0
Commit
9f8199c0
authored
Oct 03, 2012
by
Leo Gordon
Browse files
Fetching data via AnalysisAdaptor allows to print logic_names of failed analyses
parent
2f6e591c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
20 deletions
+34
-20
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisAdaptor.pm
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisAdaptor.pm
+7
-0
modules/Bio/EnsEMBL/Hive/Queen.pm
modules/Bio/EnsEMBL/Hive/Queen.pm
+27
-20
No files found.
modules/Bio/EnsEMBL/Hive/DBSQL/AnalysisAdaptor.pm
View file @
9f8199c0
...
...
@@ -46,6 +46,13 @@ sub object_class {
}
sub
fetch_all_failed_analyses
{
my
$self
=
shift
;
return
$self
->
fetch_all
(
"
JOIN analysis_stats s USING(analysis_id) WHERE s.status='FAILED'
"
);
}
=head2 fetch_by_logic_name_or_url
Description: given a URL gets the analysis from URLFactory, otherwise fetches it from the db
...
...
modules/Bio/EnsEMBL/Hive/Queen.pm
View file @
9f8199c0
...
...
@@ -649,30 +649,37 @@ sub synchronize_AnalysisStats {
}
=head2 get_num_failed_analyses
Arg [1] : Bio::EnsEMBL::Hive::AnalysisStats object (optional)
Example : if( $self->get_num_failed_analyses( $my_analysis )) { do_something; }
Example : my $num_failed_analyses = $self->get_num_failed_analyses();
Description: Reports all failed analyses and returns
either the number of total failed (if no $filter_analysis was provided)
or 1/0, depending on whether $filter_analysis failed or not.
Returntype : int
Exceptions : none
Caller : general
=cut
sub
get_num_failed_analyses
{
my
(
$self
,
$analysis
)
=
@_
;
my
(
$self
,
$
filter_
analysis
)
=
@_
;
my
$statsDBA
=
$self
->
db
->
get_AnalysisStatsAdaptor
;
my
$failed_analyses
=
$statsDBA
->
fetch_by_statuses_rc_id
(['
FAILED
']);
if
(
$analysis
)
{
foreach
my
$this_failed_analysis
(
@$failed_analyses
)
{
if
(
$this_failed_analysis
->
analysis_id
==
$analysis
->
dbID
)
{
print
"
#########################################################
\n
",
"
Too many jobs failed for analysis
"
.
$analysis
->
logic_name
.
"
. FAIL!!
\n
",
"
#########################################################
\n\n
";
return
1
;
}
}
return
0
;
}
my
$failed_analyses
=
$self
->
db
->
get_AnalysisAdaptor
->
fetch_all_failed_analyses
();
if
(
@$failed_analyses
)
{
print
"
##################################################
\n
",
"
Too many failed jobs. FAIL!!
\n
",
"
##################################################
\n
";
}
my
$filter_analysis_failed
=
0
;
foreach
my
$failed_analysis
(
@$failed_analyses
)
{
print
"
\t
##########################################################
\n
";
print
"
\t
# Too many jobs in analysis '
"
.
$failed_analysis
->
logic_name
.
"
' FAILED #
\n
";
print
"
\t
##########################################################
\n\n
";
if
(
$filter_analysis
and
(
$filter_analysis
->
dbID
==
$failed_analysis
))
{
$filter_analysis_failed
=
1
;
}
}
return
scalar
(
@$failed_analyses
);
return
$filter_analysis
?
$filter_analysis_failed
:
scalar
(
@$failed_analyses
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment