Skip to content

Add hykuup:tenants:usage rake task for per-tenant usage reporting - #697

Open
ShanaLMoore wants to merge 3 commits into
mainfrom
tenant-usage-report
Open

ShanaLMoore wants to merge 3 commits into
mainfrom
tenant-usage-report

Conversation

@ShanaLMoore

Copy link
Copy Markdown
Contributor

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).

TENANT                             WORKS     FILES         STORAGE
--------------------------------------------------------------------
truman.digitalmobius.org            4601     16087        58.30 GB
webster.digitalmobius.org            293       396        28.35 GB
nwmsu.digitalmobius.org              386       390        27.42 GB
jewell.digitalmobius.org             662       584         9.78 GB
mbts.digitalmobius.org              1842      1919         6.92 GB
moval.digitalmobius.org              145       147         4.87 GB
mssu.digitalmobius.org              4247      4247         3.22 GB
stlcc.digitalmobius.org              136       145         2.74 GB
covenant.digitalmobius.org           359       392         1.82 GB
crowder.digitalmobius.org            353       353         1.72 GB
stephens.digitalmobius.org            76        82         1.69 GB
ccis.digitalmobius.org              1043      1082         1.20 GB
sbuniv.digitalmobius.org             420       422       815.24 MB
mobap.digitalmobius.org               58        58        55.12 MB
atsu.digitalmobius.org                 3         5        53.77 MB
kenrick.digitalmobius.org              7         5         8.30 MB
eastcentral.digitalmobius.org          0         0          0.00 B
--------------------------------------------------------------------
TOTAL (17 tenants)                 14631     26314       148.93 GB

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>
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Test Results

     4 files  ±  0       4 suites  ±0   7s ⏱️ ±0s
53 638 tests +788  53 638 ✅ +788  0 💤 ±0  0 ❌ ±0 
   122 runs  +  1     122 ✅ +  1  0 💤 ±0  0 ❌ ±0 

Results for commit cfbc795. ± Comparison against base commit cfd424c.

♻️ This comment has been updated with latest results.

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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 sum file_size_lts.
  • Documents the new rake task and its output formats in the README.
  • Adds a bin/mobius_usage.rb rails-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.

Comment thread lib/tasks/hyku_knapsack_tasks.rake
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>
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