Add admincli report toolkit for period-bounded usage reports#1690
Merged
Conversation
AdminDBTopLevel gains an AsOfMetric enum, an ActiveUser record, and four period/asof query methods (countNewUsers, countSimJobsInDb, countAsOf, listActiveUsersInPeriod) so callers can request NIH-RPPR-style metrics for arbitrary [start, end] windows. Queries reference column names via Table-class Field objects and bind dates with PreparedStatement.setDate rather than embedding literals. CLIDatabaseService gets thin wrappers. The cascade-delete behavior of vc_simulationjob is called out in the countSimJobsInDb Javadoc since it makes that metric structurally unreliable for historical reporting; SLURM sacct remains the source of truth for jobs ever submitted to the compute cluster. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Four single-purpose picocli commands grouped under `admincli report`: count-new-users, count-sim-jobs-in-db, count-asof, list-active-users. Each command emits a single integer (or a CSV for list-active-users) on stdout with a human-readable description on stderr, so they compose cleanly in shell pipelines. The modular shape is deliberate so next year's reporting request can add a new metric with a single new SQL method (or just a new AsOfMetric enum value) without touching the existing commands. Package-info.java cross-references the .claude/commands/admin-report.md slash-command skill for the toolkit overview and the cascade-delete / SLURM caveats. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tools/report/rppr-2026.sh wraps the admincli `report` subcommands for the NIH RPPR usage report. It expects DB credentials from environment (VCELL_DB_URL / DRIVER / USER / PASSWORD — use the dev role, not the service role) and assumes the Maven project is already built; the script fails fast with a helpful message if vcell-admin/target/maven-jars is missing rather than triggering a slow rebuild on every invocation. The /admin-report slash-command skill documents what each metric means, the SLURM sacct command for the true count of jobs submitted to the compute cluster (vc_simulationjob is cascade-delete-eroded and not reliable for historical reporting), and a checklist for adding new metrics next year. .gitignore adds tools/report/output/ plus user-PII patterns (users_*.txt, users_*.csv, active_users*.csv) so per-user lists with emails / names / affiliations stay local and are never committed. Co-Authored-By: Claude Opus 4.7 (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.
Summary
admincli reportsubcommand kit (four single-purpose picocli commands) for NIH-RPPR-style usage metrics over arbitrary[start, end]windows.AdminDBTopLeveluse Table-classField.getQualifiedColName()references andPreparedStatementdate binding rather than embedded literals.tools/report/rppr-2026.shruns the suite end-to-end against thevcell_devrole./admin-reportslash-command skill documents the toolkit, the SLURMsacctcaveat for the true count of jobs submitted to the compute cluster, and a checklist for adding new metrics next year..gitignoreadds user-PII patterns (users_*.txt,users_*.csv,active_users*.csv) andtools/report/output/so per-user lists with emails/names/affiliations stay local.Why this shape
Next year's reporting request will likely have a different shape (different metrics, different groupings). Each command does one thing, so adding a new metric is one new SQL method + (for new categories) one new ~40-line command class. The
count-asofcommand is enum-driven; adding a new as-of metric is one enum value plus a SQL branch — no new command class needed.Commands
Each count command emits the integer on stdout with a human-readable description on stderr;
list-active-usersemits CSV (userid,email,company,country,tld_extension).Caveats documented in the code and skill
vc_simulationjobcascade-deletes when its parent simulation is removed/replaced, socount-sim-jobs-in-dbis structurally unreliable for historical reporting. The true count of jobs submitted to the compute cluster lives in SLURM accounting (sacct). The skill markdown documents the exactsacctinvocation.Test plan
mvn compile test-compile -pl vcell-admin,vcell-server -am— BUILD SUCCESSvcell_devrole for two periods (2024-04-01..2025-06-30 and 2025-07-01..2026-05-01); cumulative as-of numbers cross-check vs/api/v1/admin/usagesnapshotusers_*.txt, generatedactive_users*.csv,tools/report/output/) are excluded from gitsacctintegration is intentionally out of scope; documented as a separate one-line invocation on the HTC head node🤖 Generated with Claude Code