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

DURACLOUD-1279: Adds snapshot totals information to the UI, companion PR to DURACLOUD-1150 #152

Merged
merged 4 commits into from Nov 11, 2021

Conversation

nwoodward
Copy link
Contributor

@nwoodward nwoodward commented Nov 9, 2021

This PR builds on the work of DURACLOUD-1150 to present information about snapshots (total count, size and files) in the UI.


JIRA Ticket: https://duracloud.atlassian.net/browse/DURACLOUD-1279

What does this Pull Request do?

This PR adds a snapshot totals pane to the GUI for snapshot storage providers when no spaces are selected. It uses the API calls added in DURACLOUD-1150 to get the statistics.

How should this be tested?

  • Deploy DuraCloud and select a storage provider such as Chronopolis to see the stats
  • Compare the values with what's in your Bridge's database, substituting your host for $HOST:
    • SELECT COUNT(id) FROM snapshot WHERE host = '$HOST' AND status = 'SNAPSHOT_COMPLETE';
    • SELECT SUM(total_size_in_bytes) FROM snapshot WHERE host = '$HOST' AND status = 'SNAPSHOT_COMPLETE';
    • SELECT COUNT(sci.id) FROM snapshot s LEFT JOIN snapshot_content_item sci ON s.id = sci.snapshot_id WHERE s.host = '$HOST' AND s.status = 'SNAPSHOT_COMPLETE';

Interested parties

Tag @duracloud/committers

@dbernstein dbernstein self-requested a review November 9, 2021 23:58
Copy link
Member

@dbernstein dbernstein left a comment

Choose a reason for hiding this comment

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

Nice work @nwoodward . It works perfectly. A

public GetSnapshotsTotalsTaskResult getSnapshotsTotals(String status)
throws ContentStoreException {
if (null == status) {
status = "SNAPSHOT_COMPLETE";
Copy link
Member

Choose a reason for hiding this comment

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

define a constant for SNAPSHOT_COMPLETE if it is not already defined elsewhere?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe add it to SnapshotConstants?

@dbernstein
Copy link
Member

One note: you need to specify the host on the above SQL queries if you have more than one host in your snapshot table.

@dbernstein
Copy link
Member

This PR is good to go - one little suggestion but not required to fix.

@dbernstein dbernstein merged commit aecc0ff into duracloud:develop Nov 11, 2021
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.

None yet

2 participants