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
088529b5
Commit
088529b5
authored
20 years ago
by
Jessica Severin
Browse files
Options
Downloads
Patches
Plain Diff
reformated code (removed all the tabs)
parent
2f244c5b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Hive/Queen.pm
+51
-51
51 additions, 51 deletions
modules/Bio/EnsEMBL/Hive/Queen.pm
with
51 additions
and
51 deletions
modules/Bio/EnsEMBL/Hive/Queen.pm
+
51
−
51
View file @
088529b5
...
...
@@ -131,7 +131,7 @@ sub create_new_worker {
$beekeeper
=
''
unless
(
$beekeeper
);
my
$sql
=
"
INSERT INTO hive SET born=now(), last_check_in=now(),
"
.
"
process_id=?, analysis_id=?, beekeeper=?, host=?
";
"
process_id=?, analysis_id=?, beekeeper=?, host=?
";
my
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
(
$pid
,
$analysisStats
->
analysis_id
,
$beekeeper
,
$host
);
...
...
@@ -255,69 +255,69 @@ sub synchronize_hive {
sub
synchronize_AnalysisStats
{
my
$self
=
shift
;
my
$analysisStats
=
shift
;
my
$analysisStats
=
shift
;
return
$analysisStats
unless
(
$analysisStats
);
return
$analysisStats
unless
(
$analysisStats
->
analysis_id
);
return
$analysisStats
if
(
$analysisStats
->
status
eq
'
BLOCKED
');
return
$analysisStats
if
(
$analysisStats
->
status
eq
'
SYNCHING
');
return
$analysisStats
unless
(
$analysisStats
->
analysis_id
);
return
$analysisStats
if
(
$analysisStats
->
status
eq
'
BLOCKED
');
return
$analysisStats
if
(
$analysisStats
->
status
eq
'
SYNCHING
');
$analysisStats
->
update_status
('
SYNCHING
');
$analysisStats
->
total_job_count
(
0
);
$analysisStats
->
unclaimed_job_count
(
0
);
$analysisStats
->
done_job_count
(
0
);
$analysisStats
->
failed_job_count
(
0
);
$analysisStats
->
num_required_workers
(
0
);
my
$sql
=
"
SELECT status, count(*) FROM analysis_job
"
.
"
WHERE analysis_id=? GROUP BY status
";
my
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
(
$analysisStats
->
analysis_id
);
while
(
my
(
$status
,
$count
)
=
$sth
->
fetchrow_array
())
{
my
$total
=
$analysisStats
->
total_job_count
();
$analysisStats
->
total_job_count
(
$total
+
$count
);
if
(
$status
eq
'
READY
')
{
$analysisStats
->
unclaimed_job_count
(
$count
);
my
$numWorkers
=
$count
/
$analysisStats
->
batch_size
;
$numWorkers
=
1
if
(
$numWorkers
<
1
);
if
(
$analysisStats
->
hive_capacity
>
0
and
$numWorkers
>
$analysisStats
->
hive_capacity
)
{
$numWorkers
=
$analysisStats
->
hive_capacity
;
}
$analysisStats
->
num_required_workers
(
$numWorkers
);
}
if
(
$status
eq
'
DONE
')
{
$analysisStats
->
done_job_count
(
$count
);
}
if
(
$status
eq
'
FAILED
')
{
$analysisStats
->
failed_job_count
(
$count
);
}
}
$sth
->
finish
;
$analysisStats
->
determine_status
();
$analysisStats
->
total_job_count
(
0
);
$analysisStats
->
unclaimed_job_count
(
0
);
$analysisStats
->
done_job_count
(
0
);
$analysisStats
->
failed_job_count
(
0
);
$analysisStats
->
num_required_workers
(
0
);
my
$sql
=
"
SELECT status, count(*) FROM analysis_job
"
.
"
WHERE analysis_id=? GROUP BY status
";
my
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
(
$analysisStats
->
analysis_id
);
while
(
my
(
$status
,
$count
)
=
$sth
->
fetchrow_array
())
{
my
$total
=
$analysisStats
->
total_job_count
();
$analysisStats
->
total_job_count
(
$total
+
$count
);
if
(
$status
eq
'
READY
')
{
$analysisStats
->
unclaimed_job_count
(
$count
);
my
$numWorkers
=
$count
/
$analysisStats
->
batch_size
;
$numWorkers
=
1
if
(
$numWorkers
<
1
);
if
(
$analysisStats
->
hive_capacity
>
0
and
$numWorkers
>
$analysisStats
->
hive_capacity
)
{
$numWorkers
=
$analysisStats
->
hive_capacity
;
}
$analysisStats
->
num_required_workers
(
$numWorkers
);
}
if
(
$status
eq
'
DONE
')
{
$analysisStats
->
done_job_count
(
$count
);
}
if
(
$status
eq
'
FAILED
')
{
$analysisStats
->
failed_job_count
(
$count
);
}
}
$sth
->
finish
;
$analysisStats
->
determine_status
();
#
# adjust_stats_for_living_workers
#
if
(
$analysisStats
->
hive_capacity
>
0
)
{
my
$sql
=
"
SELECT count(*) FROM hive WHERE cause_of_death='' and analysis_id=?
";
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
(
$analysisStats
->
analysis_id
);
my
(
$liveCount
)
=
$sth
->
fetchrow_array
();
$sth
->
finish
;
my
$numWorkers
=
$analysisStats
->
num_required_workers
;
my
$capacityAdjust
=
(
$numWorkers
+
$liveCount
)
-
$analysisStats
->
hive_capacity
;
$numWorkers
-=
$capacityAdjust
if
(
$capacityAdjust
>
0
);
$numWorkers
=
0
if
(
$numWorkers
<
0
);
$analysisStats
->
num_required_workers
(
$numWorkers
);
if
(
$analysisStats
->
hive_capacity
>
0
)
{
my
$sql
=
"
SELECT count(*) FROM hive WHERE cause_of_death='' and analysis_id=?
";
$sth
=
$self
->
prepare
(
$sql
);
$sth
->
execute
(
$analysisStats
->
analysis_id
);
my
(
$liveCount
)
=
$sth
->
fetchrow_array
();
$sth
->
finish
;
my
$numWorkers
=
$analysisStats
->
num_required_workers
;
my
$capacityAdjust
=
(
$numWorkers
+
$liveCount
)
-
$analysisStats
->
hive_capacity
;
$numWorkers
-=
$capacityAdjust
if
(
$capacityAdjust
>
0
);
$numWorkers
=
0
if
(
$numWorkers
<
0
);
$analysisStats
->
num_required_workers
(
$numWorkers
);
}
$analysisStats
->
update
;
return
$analysisStats
;
return
$analysisStats
;
}
...
...
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