Skip to content

Log the slow suppliers (dev mode) and catch exceptions - #8269

Merged
labkey-adam merged 2 commits into
developfrom
fb_usage_metric_supplier_safety
Nov 1, 2026
Merged

labkey-adam merged 2 commits into
developfrom
fb_usage_metric_supplier_safety

Conversation

@labkey-adam

@labkey-adam labkey-adam commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

Wrap all usage metrics supplier dereferences with a helper method that:

  • When in dev mode, determines execution time and logs slow pokes (> 1 second)
  • Catches and reports exceptions on a per-supplier basis

Introduce NightlyRecalculatingSuppliers, which provides caching suppliers that persist and recalculate nightly. Use them to speed up five slow usage metrics suppliers.

Related Pull Requests

@labkey-adam labkey-adam self-assigned this Oct 31, 2026
@labkey-adam labkey-adam added this to the 26.11 milestone Oct 31, 2026

@labkey-jeckels labkey-jeckels 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.

This seems fine but also not really that necessary. In typical operations the server calculates metrics once a day in a background thread, so shifting to a maintenance task is OK but not a win in terms of total work.

@labkey-adam

Copy link
Copy Markdown
Contributor Author

This seems fine but also not really that necessary. In typical operations the server calculates metrics once a day in a background thread, so shifting to a maintenance task is OK but not a win in terms of total work.

Agreed, for production deployments. This is more about speeding it up for local testing and development (e.g., when adding new metrics). This reduced metrics generation locally from a somewhat annoying ~30 seconds to ~3 seconds.

@labkey-adam
labkey-adam merged commit fd4131a into develop Nov 1, 2026
10 checks passed
@labkey-adam
labkey-adam deleted the fb_usage_metric_supplier_safety branch November 1, 2026 20:50
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