Skip to content

GitHub Issue #1130: Metrics to track R & Python package usage - #3143

Merged
cnathe merged 3 commits into
developfrom
fb_pacakgeUsage1130
Aug 12, 2026
Merged

GitHub Issue #1130: Metrics to track R & Python package usage#3143
cnathe merged 3 commits into
developfrom
fb_pacakgeUsage1130

Conversation

@cnathe

@cnathe cnathe commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Rationale

https://github.com/LabKey/internal-issues/issues/1130
See related PR for rationale

Related Pull Requests

Changes

  • Selenium test case for package usage metric counts for R and Python assay transform script example

@cnathe cnathe self-assigned this Aug 4, 2026
@cnathe
cnathe requested a review from labkey-tchad August 4, 2026 20:05
cnathe added a commit to LabKey/platform that referenced this pull request Aug 12, 2026
## Rationale
LabKey/internal-issues#1130

The change instruments ExternalScriptEngine to record which R packages /
Python modules scripts load, so the counts get reported to mothership
via SimpleMetricsService. It does this by: (1) appending a
language-specific "capture epilog" to the end of the user script that
writes loaded packages to a sidecar file; (2) reading that sidecar back
after the run and incrementing a per-package counter; and (3) adding a
PythonScriptEngine subclass plus manager wiring to detect .py engines.
All metric work is wrapped so it can never break script execution.

## Related Pull Requests
- #7881
- LabKey/testAutomation#3143 

## Changes
- ExternalScriptEngine refactor to allow for getPackageCaptureEpilog,
recordPackageUsage, and recordSuccessfulRun overrides
- RScriptEngine implementations for tracking package usages and
recording via ScriptPackageUsageTracker.record()
- PythonScriptEngine implementations for tracking package usages and
recording via ScriptPackageUsageTracker.record()
- ScriptPackageUsageTracker to use SimpleMetricsService to increment
count of number of times a package was used
@cnathe
cnathe merged commit 22f7121 into develop Aug 12, 2026
6 checks passed
@cnathe
cnathe deleted the fb_pacakgeUsage1130 branch August 12, 2026 20:51
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