Repository navigation
Show N+1 issues in the issue list, sparklines and histogram - #46
Merged
Merged
Conversation
The issue list, its count and the export only matched issues with rows in events. N+1 detection records occurrences in perf_events, so these issues were missing from the list at every range and status, while the dashboard briefing and its open count read the issues table and showed them. Count perf_events as occurrences too. The lookup starts from performance issues to use perf_events_issue, since nothing else reaches that table by time. A user lens leaves them out because a transaction names no user.
GetIssueSparklines only read events, so N+1 issues always drew a flat line on the dashboard. Count perf_events as well, and stop hiding the sparkline on N+1 rows in the issue list now that it has data.
- Union events and perf_events in GetIssueHistogram so performance issues such as N+1 queries show their occurrences - Add test covering the histogram for a performance issue
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
N+1 issues record their occurrences in
perf_events, but the time-windowed issue queries, sparklines and issue histogram only readevents. As a result, open N+1 issues were missing from the issue list, its count and the export when a time range was applied. Their sparklines and detail charts also showed all zeros.These queries now read both tables. The fixes use existing
perf_eventsrows, so no migration is needed and older N+1 issues get their history back as far as retention has kept those rows.Type of change
Changes
windowIssueCTEnow includesperf_eventsoccurrences for non-error issues, so N+1 issues appear in the windowed list, count and export. It applies the same time, project and environment filters to them.GetIssueSparklinescounts occurrences from botheventsandperf_events.GetIssueHistogramcounts occurrences from both tables, so the issue detail chart is no longer empty for N+1 issues.IssueListView.vueno longer hides the sparkline onn1_queryrows.TestWindowPerformanceIssuesPlan, which checks that the windowedperf_eventslookup usesperf_events_issuerather than a sequential scan. It only runs whenTINDRA_PERF_ROWSis set to at least 10000.Review note:
GetIssueHistogramhas no time limit, so it reads every retainedperf_eventsrow for the issue, as it already does witheventsfor error issues. It only runs when an issue's detail page is opened and usesperf_events_issue, but an N+1 issue with millions of occurrences would load its chart more slowly. This hasn't been measured at scale.Test plan
n1_queryrows render a sparkline.go test -race ./...andgolangci-lintpass on the full change.Checklist
Contributor License Agreement