Skip to content

Issue #1179: Add metric for export types#7765

Merged
labkey-susanh merged 4 commits into
developfrom
fb_exportMetricsFromAudit
Jun 22, 2026
Merged

Issue #1179: Add metric for export types#7765
labkey-susanh merged 4 commits into
developfrom
fb_exportMetricsFromAudit

Conversation

@labkey-susanh

Copy link
Copy Markdown
Contributor

Rationale

Issue 1179 - Before we make changes to improve the UI for exporting multi-tab Excel files, we want to look at metrics to understand how often this feature is being used. We record and audit log in a dedicated table for each export and can use that to report numbers.

Changes

  • Add a Postgres-only metric based on the export audit log

@labkey-susanh labkey-susanh requested a review from XingY June 19, 2026 17:57

// This is an approximation of the multi-tab export count. We record an audit log for each tab, and
// they are all likely to have the same timestamp. Not exact, but perhaps good enough for current purposes.
sql = new SQLFragment("SELECT COUNT(*) FROM (SELECT *\n" +

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.

Should we add group by createdby?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea. Done.

String comment = (String) row.get("Comment");
if (comment == null)
return;
if (comment.startsWith("Exported to "))

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.

Shouldn't this exclude Multi-tab excel export? Or the excel count will be way bloated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it's OK to have the Excel count bloated. This is meant to be a short-lived metric to help us determine if the multi-tab export is in use. The other counts are mostly there just because we can. If we want something more accurate, I think we'd switch this to a client-side count based on menu choices.

I'll let @labkey-hannah weigh in (here or in the issue) if she feels differently.

@labkey-hannah

Copy link
Copy Markdown

Yea, I'm okay with it being bloated

@labkey-susanh labkey-susanh merged commit a4b813a into develop Jun 22, 2026
9 of 12 checks passed
@labkey-susanh labkey-susanh deleted the fb_exportMetricsFromAudit branch June 22, 2026 18: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.

3 participants