Skip to content

Conversation

gggritso
Copy link
Member

Continuing to replace usage of /events-stats/ with /events-timeseries/ This time, it's some usage on Insights landing pages, wherever we're not making an groupBy query. I had to make a few code changes to accommodate the new format, but for the most part things are a bit simpler now, with no need to convert data formats.

Copy link

linear bot commented Sep 23, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Sep 23, 2025
@gggritso gggritso marked this pull request as ready for review September 23, 2025 22:09
@gggritso gggritso requested review from a team as code owners September 23, 2025 22:09
const count = jobCounts[i]?.value!;
jobsCount += count;
errorCount += point.value! * count;
errorCount += item.value! * count;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Error Rate Calculation Fails with Undefined Values

The overallErrorRate calculation has a couple of issues. An unsafe non-null assertion on jobCounts[i]?.value! might cause a runtime error if jobCounts[i] is undefined (e.g., due to differing array lengths). Also, if jobsCount is zero (e.g., from empty arrays), the division results in NaN.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant