Repository navigation
GitHub Issue 1708: persist sample dashboard and insights stats - #8231
Merged
Merged
Conversation
Comment on lines
124
to
128
| SQLFragment liveCount = new SQLFragment("(SELECT COUNT(*) FROM ").append(ExperimentServiceImpl.get().getTinfoMaterial(), "m") | ||
| .unsafeAppend(" WHERE m.CpasType = ").append(ExprColumn.STR_TABLE_ALIAS + ".LSID") | ||
| .unsafeAppend(" AND ") | ||
| .append(sampleCountContainerFilter.getSQLFragment(getSchema(), new SQLFragment("m.container"))) | ||
| .unsafeAppend(")"); |
Contributor
There was a problem hiding this comment.
Move this into an else under the if statement below?
| } | ||
| catch (Exception e) | ||
| { | ||
| LOG.error("Sample counts listener failed to record a change in " + container.getPath() |
Contributor
There was a problem hiding this comment.
SQLExceptions will abort the whole transaction. We probably can't continue and need to bail out.
XingY
commented
Oct 28, 2026
| * what lets these run after the container itself is gone. | ||
| */ | ||
|
|
||
| private static class DeindexAssayBatchesTask extends AccumulatingCommitTask<String, ExpExperiment> |
Contributor
Author
There was a problem hiding this comment.
@labkey-jeckels I included some unrelated AccumulatingCommitTask switch in this branch to address the warnings logged while running tests.
labkey-jeckels
approved these changes
Oct 29, 2026
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.
Rationale
Lets a module maintain sample counts ahead of time and serve them wherever the server used to count samples live. The insights panel and the home dashboard charts recount every sample for every user on each page load, which on a large installation is among the most expensive queries a regular user can trigger, and the sample type list's count column has the same problem. Platform owns the sample write paths and the sample type table, so it has to tell a module when samples change and be able to ask it for a count, without itself knowing anything about how those counts are stored. GitHub Issue 1708: https://github.com/LabKey/internal-issues/issues/1708
Related Pull Requests
Changes