Add hykuup:tenants:usage rake task for per-tenant usage reporting - #697
Open
ShanaLMoore wants to merge 3 commits into
Open
ShanaLMoore wants to merge 3 commits into
ShanaLMoore wants to merge 3 commits into
Conversation
Reports work counts and primary-file storage per tenant, optionally scoped to a consortium. Pages FileSet docs and sums file_size_lts in Ruby, since that field is stored-but-not-indexed in Solr and cannot be summed via stats (which is why Hyku's tenants:calculate_usage reports 0 on Valkyrie/flexible-metadata indexes). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract Solr cursor-paging into file_set_page/sum_page helpers to keep tenant_file_storage and the find_each block under Metrics limits, and hold format strings in variables so the dynamic width no longer trips Lint/FormatParameterMismatch. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a tenant usage-reporting capability to HykuUp, producing per-tenant work counts and primary-file storage totals (with optional consortium scoping) in either a human-friendly table or CSV.
Changes:
- Introduces
hykuup:tenants:usage[consortium]rake task that switches tenants, counts works, and pages FileSet Solr docs to sumfile_size_lts. - Documents the new rake task and its output formats in the README.
- Adds a
bin/mobius_usage.rbrails-runner script that performs similar reporting focused on Mobius (or all tenants via env).
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Adds usage documentation and examples for the new tenant usage reporting task. |
| lib/tasks/hyku_knapsack_tasks.rake | Implements hykuup:tenants:usage and supporting Solr paging + aggregation helpers. |
| bin/mobius_usage.rb | Adds a rails-runner script for usage reporting (overlaps with the new rake task). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Match the code to the documentation and make cursorMark paging easier to debug by requesting id alongside file_size_lts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or 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
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.
Reports work counts and primary-file storage per tenant, optionally scoped to a consortium. Pages FileSet docs and sums file_size_lts in Ruby, since that field is stored-but-not-indexed in Solr and cannot be summed via stats (which is why Hyku's tenants:calculate_usage reports 0 on Valkyrie/flexible-metadata indexes).