Commit 07c188fe authored by Leo Gordon's avatar Leo Gordon
Browse files

moved creation of both 'lsf_report' table and 'lsf_usage' view into scripts/lsf_report.pl

parent 5be86a15
......@@ -48,6 +48,21 @@ sub main {
) ENGINE=InnoDB;
});
warn "Creating the 'lsf_usage' view if it doesn't exist...\n";
$dbc->do (qq{
CREATE OR REPLACE VIEW lsf_usage AS
SELECT CONCAT(logic_name,'(',analysis_id,')') analysis_name_and_id,
rc_id, count(*) workers,
min(mem), avg(mem), max(mem),
min(swap), avg(swap), max(swap)
FROM analysis
JOIN analysis_stats USING(analysis_id)
LEFT JOIN worker USING(analysis_id)
LEFT JOIN lsf_report USING (process_id)
GROUP BY analysis_id
ORDER BY analysis_id;
});
if( $bacct_source_line && -r $bacct_source_line ) {
warn "Parsing given bacct file '$bacct_source_line'...\n";
......@@ -61,6 +76,10 @@ sub main {
my ($from_time, $to_time) = $sth_times->fetchrow_array();
$sth_times->finish();
unless(defined($from_time) and defined($to_time)) {
die "There seems to be no information on workers, exiting...\n";
}
$from_time=~s/[- ]/\//g;
$from_time=~s/:\d\d$//;
$to_time=~s/[- ]/\//g;
......
......@@ -24,26 +24,6 @@ CREATE OR REPLACE VIEW progress AS
ORDER BY a.analysis_id, j.status;
#### show LSF resource usage measured by lsf_report.pl script (won't show much if you haven't run the script)
#
# Usage:
# select * from lsf_usage; # the whole table
# select * from lsf_usage where analysis_name_and_id like 'family_blast%'; # filter by analysis_name pattern
# select * from lsf_usage where rc_id=5; # filter by specific rc_id
CREATE OR REPLACE VIEW lsf_usage AS
SELECT CONCAT(logic_name,'(',analysis_id,')') analysis_name_and_id,
rc_id, count(*) workers,
min(mem), avg(mem), max(mem),
min(swap), avg(swap), max(swap)
FROM analysis
JOIN analysis_stats USING(analysis_id)
JOIN worker USING(analysis_id)
LEFT JOIN lsf_report USING (process_id)
GROUP BY analysis_id
ORDER BY analysis_id;
#### a convenient view that also incorporates (otherwise redundant) analysis_id and logic_name ###########
#
# Usage:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment