Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl-hive
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl-hive
Commits
574ea28c
Commit
574ea28c
authored
10 years ago
by
Leo Gordon
Browse files
Options
Downloads
Patches
Plain Diff
moving code that stores resource usage into Queen::store_resource_usage and calling it from there
parent
8ad9df2a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/Bio/EnsEMBL/Hive/Queen.pm
+26
-0
26 additions, 0 deletions
modules/Bio/EnsEMBL/Hive/Queen.pm
scripts/lsf_report.pl
+3
-12
3 additions, 12 deletions
scripts/lsf_report.pl
with
29 additions
and
12 deletions
modules/Bio/EnsEMBL/Hive/Queen.pm
+
26
−
0
View file @
574ea28c
...
...
@@ -416,6 +416,11 @@ sub check_for_dead_workers { # scans the whole Valley for lost Workers (but i
$worker
->
cause_of_death
(
$report_entries
->
{
$process_id
}{'
cause_of_death
'}
);
$self
->
register_worker_death
(
$worker
);
}
if
(
%$report_entries
)
{
# use the opportunity to also store resource usage of the buried workers:
my
$processid_2_workerid
=
{
map
{
$_
=>
$pid_to_lost_worker
->
{
$_
}
->
dbID
}
keys
%$pid_to_lost_worker
};
$self
->
store_resource_usage
(
$report_entries
,
$processid_2_workerid
);
}
}
}
...
...
@@ -752,4 +757,25 @@ sub register_all_workers_dead {
}
sub
store_resource_usage
{
my
(
$self
,
$report_entries
,
$processid_2_workerid
)
=
@_
;
my
$sql_replace
=
'
REPLACE INTO worker_resource_usage (worker_id, exit_status, mem_megs, swap_megs, pending_sec, cpu_sec, lifespan_sec, exception_status) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
';
my
$sth_replace
=
$self
->
prepare
(
$sql_replace
);
my
@not_ours
=
();
while
(
my
(
$process_id
,
$report_entry
)
=
each
%$report_entries
)
{
if
(
my
$worker_id
=
$processid_2_workerid
->
{
$process_id
}
)
{
$sth_replace
->
execute
(
$worker_id
,
@$report_entry
{'
exit_status
',
'
mem_megs
',
'
swap_megs
',
'
pending_sec
',
'
cpu_sec
',
'
lifespan_sec
',
'
exception_status
'}
);
# slicing hashref
}
else
{
push
@not_ours
,
$process_id
;
#warn "\tDiscarding process_id=$process_id as probably not ours because it could not be mapped to a Worker\n";
}
}
$sth_replace
->
finish
();
}
1
;
This diff is collapsed.
Click to expand it.
scripts/lsf_report.pl
+
3
−
12
View file @
574ea28c
...
...
@@ -111,20 +111,11 @@ sub main {
my
$report_entries
=
Bio::EnsEMBL::Hive::Meadow::LSF::
parse_report_source_line
(
$bacct_source_line
);
my
$
processid_2_workerid
=
$hive_dba
->
get_WorkerAdaptor
()
->
fetch_by_meadow_type_AND_meadow_name_HASHED_FROM_process_id_TO_worker_id
(
'
LSF
',
$this_lsf_farm
)
;
my
$
queen
=
$hive_dba
->
get_Queen
;
my
$
sth_replace
=
$dbc
->
prepare
(
'
REPLACE INTO worker_resource_usage (worker_id, exit_status, mem_megs, swap_megs, pending_sec, cpu_sec, lifespan_sec, exception_status) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
'
);
my
$
processid_2_workerid
=
$queen
->
fetch_by_meadow_type_AND_meadow_name_HASHED_FROM_process_id_TO_worker_id
(
'
LSF
',
$this_lsf_farm
);
while
(
my
(
$process_id
,
$report_entry
)
=
each
%$report_entries
)
{
if
(
my
$worker_id
=
$processid_2_workerid
->
{
$process_id
}
)
{
$sth_replace
->
execute
(
$worker_id
,
@$report_entry
{'
exit_status
',
'
mem_megs
',
'
swap_megs
',
'
pending_sec
',
'
cpu_sec
',
'
lifespan_sec
',
'
exception_status
'}
);
# slicing hashref
}
else
{
warn
"
\t
Discarding process_id=
$process_id
as probably not ours because it could not be mapped to a Worker
\n
";
}
}
$sth_replace
->
finish
();
warn
"
\n
Report has been loaded into pipeline's 'worker_resource_usage' table. Enjoy.
\n
";
$queen
->
store_resource_usage
(
$report_entries
,
$processid_2_workerid
);
}
__DATA__
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment