perf: Refactor groupChartData to O(n) mathematical spatial indexing - #97
Conversation
|
@mohit-bhandari45 is attempting to deploy a commit to the OpenStatus Team on Vercel. A member of the Team first needs to authorize it. |
|
@mxkaske When you get time do review this pr. |
|
@claude review |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @mxkaske's task in 2m 25s —— View job Code Review:
|
|
@claude review |
|
@claude review |
|
@mxkaske do review this. |
Fixes #96
Summary
This PR addresses significant performance and technical debt in the timeline chart generation logic (groupChartData) on the backend API.
Previously, the time-interval aggregation algorithm relied on an
O(n*t)nested iteration (executingdata.filter()continuously inside an iterative loop over every sequential time bucket). For large log sets, this caused hundreds of thousands of blockingArray.prototype.filterpasses within the Node event loop. Additionally, the log categories (success,warning,error) were statically hardcoded, breaking the chart if a new level was ever introduced to the schema.Changes Made
Math.floor(timeDifference / interval)), entirely eliminating all.filter()passes."success","error","warning"keys. The engine now dynamically maps generation against the globalLEVELSschema constant, making timeline categorization incredibly flexible out-of-the-box.// TODOcomments tied to algorithmic efficiency, typings, and frontend presentation bounds.Impact