Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced a textual listing of instruments. #832

Merged
merged 4 commits into from
Jul 11, 2024

Conversation

mgcam
Copy link
Member

@mgcam mgcam commented May 30, 2024

Added a column for recently used staging servers so that the loaders can easily spot instruments, which write to the same server.

Added a column for recently used staging servers so that
the loaders can easily spot instruments, which write to the
same server.
@mgcam mgcam force-pushed the recent_staging_area branch from 9649c4d to 2b42748 Compare May 31, 2024 10:05
... to reflect the nature of the displayed data.
Comment on lines 396 to 406
ORDER BY date DESC];
my $dbh = $self->util->dbh();
# Four rather than two latest runs since NovaSeq(X) instruments have
# two sides, which write to the same staging server.
my $rows = $dbh->selectall_arrayref($query, {RaiseError => 1, MaxRows => 4},
$self->id_instrument(), $run_status);
my @globs = uniq map { $_->[0] } @{$rows};
# We do not need more that two unique globs.
while (scalar @globs > 2) {
pop @globs
}
Copy link
Member

@dkj dkj Jun 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ORDER BY date DESC];
my $dbh = $self->util->dbh();
# Four rather than two latest runs since NovaSeq(X) instruments have
# two sides, which write to the same staging server.
my $rows = $dbh->selectall_arrayref($query, {RaiseError => 1, MaxRows => 4},
$self->id_instrument(), $run_status);
my @globs = uniq map { $_->[0] } @{$rows};
# We do not need more that two unique globs.
while (scalar @globs > 2) {
pop @globs
}
ORDER BY date DESC
LIMIT 4 ];
my $dbh = $self->util->dbh();
# Four rather than two latest runs since NovaSeq(X) instruments have
# two sides, which write to the same staging server.
my $rows = $dbh->selectall_arrayref($query, {RaiseError => 1, MaxRows => 4},
$self->id_instrument(), $run_status);
my @globs = uniq map { $_->[0] } @{$rows};
# We do not need more that two unique globs.
while (scalar @globs > 2) {
pop @globs
}

Probably not worth it! (Thinking aloud...)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is to limit to 4 rows, then it is aleady done by MaxRows => 4

@dkj
Copy link
Member

dkj commented Jun 3, 2024

How about finding the last two staging areas used rather than the staging areas for last two runs?

SELECT folder_path_glob, SUBSTRING_INDEX(SUBSTRING_INDEX(folder_path_glob, "/", 3),"/",-1) staging_area, DATE(MAX(run_status.date)) mxdate FROM instrument                 JOIN run USING(id_instrument)                 JOIN run_status USING(id_run)                 JOIN run_status_dict USING(id_run_status_dict)                 WHERE folder_path_glob IS NOT NULL                 AND LENGTH(folder_path_glob) != 0                 AND id_instrument=160 AND description="run in progress" GROUP BY staging_area ORDER BY mxdate DESC LIMIT 2;
+-------------------------------------------------+--------------------+------------+
| folder_path_glob                                | staging_area       | mxdate     |
+-------------------------------------------------+--------------------+------------+
| /{export,nfs}/esa-sv-20201215-02/IL_seq_data/*/ | esa-sv-20201215-02 | 2024-05-28 |
| /{export,nfs}/esa-sv-20220405-02/IL_seq_data/*/ | esa-sv-20220405-02 | 2022-06-28 |
+-------------------------------------------------+--------------------+------------+

@mgcam
Copy link
Member Author

mgcam commented Jun 3, 2024

How about finding the last two staging areas used rather than the staging areas for last two runs?

Possible. Having talked to @jmtcsngr I tried to fetch recently used staging areas rather than two last used

@mgcam mgcam force-pushed the recent_staging_area branch from 82962ae to 5efbb3a Compare June 4, 2024 16:35
@mgcam mgcam marked this pull request as draft June 4, 2024 16:57
@mgcam mgcam marked this pull request as ready for review July 11, 2024 08:46
@dkj dkj merged commit 03bf883 into wtsi-npg:devel Jul 11, 2024
2 checks passed
@mgcam mgcam deleted the recent_staging_area branch January 3, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants