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
ca0fb028
Commit
ca0fb028
authored
Jun 22, 2012
by
Matthieu Muffato
Browse files
Now accepts two parameters on the command line: "start_date" and "end_date"
parent
7dd7a413
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
7 deletions
+23
-7
scripts/lsf_report.pl
scripts/lsf_report.pl
+23
-7
No files found.
scripts/lsf_report.pl
View file @
ca0fb028
...
...
@@ -15,12 +15,14 @@ exit(0);
sub
main
{
my
(
$url
,
$bacct_source_line
,
$lsf_user
,
$help
);
my
(
$url
,
$bacct_source_line
,
$lsf_user
,
$help
,
$start_date
,
$end_date
);
GetOptions
(
'
url=s
'
=>
\
$url
,
'
dump|file=s
'
=>
\
$bacct_source_line
,
'
lu|lsf_user=s
'
=>
\
$lsf_user
,
'
sd|start_date=s
'
=>
\
$start_date
,
'
ed|end_date=s
'
=>
\
$end_date
,
'
h|help
'
=>
\
$help
,
);
...
...
@@ -80,10 +82,21 @@ sub main {
die
"
There seems to be no information on workers, exiting...
\n
";
}
$from_time
=~
s/[- ]/\//g
;
$from_time
=~
s/:\d\d$//
;
$to_time
=~
s/[- ]/\//g
;
$to_time
=~
s/:\d\d$//
;
if
(
defined
$start_date
)
{
die
"
start_date must be in a format like '2012/01/25/13:46'
"
unless
$start_date
=~
/^\d{4}\/\d{2}\/\d{2}\/\d{2}:\d{2}$/
;
$from_time
=
$start_date
;
}
else
{
$from_time
=~
s/[- ]/\//g
;
$from_time
=~
s/:\d\d$//
;
}
if
(
defined
$end_date
)
{
die
"
end_date must be in a format like '2012/01/25/13:46'
"
unless
$end_date
=~
/^\d{4}\/\d{2}\/\d{2}\/\d{2}:\d{2}$/
;
$to_time
=
$end_date
;
}
else
{
$to_time
=~
s/[- ]/\//g
;
$to_time
=~
s/:\d\d$//
;
}
warn
"
\t
from=
$from_time
, to=
$to_time
\n
";
...
...
@@ -148,8 +161,9 @@ __DATA__
This script is used for offline examination of resources used by a Hive pipeline running on LSF
(the script is [Pp]latform-dependent).
Based on the start time of the first worker and end time of the last worker (as recorded in pipeline DB)
it pulls the relevant data out of LSF's 'bacct' database, parses it and stores in 'lsf_report' table.
Based on the command-line parameters 'start_date' and 'end_date', or on the start time of the first
worker and end time of the last worker (as recorded in pipeline DB), it pulls the relevant data out
of LSF's 'bacct' database, parses it and stores in 'lsf_report' table.
You can join this table to 'worker' table USING(process_id) in the usual MySQL way
to filter by analysis_id, do various stats, etc.
...
...
@@ -179,6 +193,8 @@ __DATA__
-url <url string> : url defining where hive database is located
-dump <filename> : a filename for bacct dump. It will be read from if the file exists, and written to otherwise.
-lsf_user <username> : if it wasn't you who ran the pipeline, LSF user name of that user can be provided
-start_date <date> : minimal start date of a job (the format is '2012/01/25/13:46')
-end_date <date> : maximal end date of a job (the format is '2012/01/25/13:46')
=head1 CONTACT
...
...
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