-
Notifications
You must be signed in to change notification settings - Fork 496
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
File metrics fixes #11189
Open
qqmyers
wants to merge
2
commits into
IQSS:develop
Choose a base branch
from
GlobalDataverseCommunityConsortium:Metrics-fix_file/monthly
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
File metrics fixes #11189
qqmyers
wants to merge
2
commits into
IQSS:develop
from
GlobalDataverseCommunityConsortium:Metrics-fix_file/monthly
+14
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/monthly to only count when files are first added to a version (and not add to the count when they are republished in a new version) /toMonth and / - count files available in prior released versions (but removed from the latest) as well as all of those in the latest version (as of the given date)
Perhaps useful, and humorous:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As reported in a community email by LauraH@DANS, the total from the /api/info/metrics/files/monthly endpoint doesn't match the output from the /api/info/metrics/files endpoint.
Investigating the queries in the code, it appears that the /monthly endpoint was over-counting files by counting a file once per released dataset version (with counts in the month of the release) IF the versions were published more than a month apart.
Conversely, it also appears that the /files and /toMonth endpoints under-count files in that they did not count files that exist in a published dataset version but do not exist in the latest published version.
This PR updates the queries to avoid these issues.
What this PR does / why we need it:
Which issue(s) this PR closes:
Special notes for your reviewer: See the comment below if you'd like an AI-assisted analysis of what the monthly query does.
Suggestions on how to test this: Probably the easiest way to test is to start with an empty DB so you can keep manual count of files. To test all the cases here, you should have a dataset that has multiple versions adding files, with versions published more than a month apart (or dates edited appropriately), and some files deleted from the latest published version.
In all cases, the sum from the monthly time series should match the total from the /files API call, and both should total to the number of unique files in all released versions.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: