[core] Limit the statistics number of observations#2985
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (31.25%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #2985 +/- ##
===========================================
- Coverage 79.80% 79.74% -0.07%
===========================================
Files 64 64
Lines 8674 8732 +58
===========================================
+ Hits 6922 6963 +41
- Misses 1752 1769 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR enhances the runtime statistics collection so memory usage stays bounded over long sessions by limiting stored samples and progressively downsampling while increasing the sampling interval.
Changes:
- Added a
maxPointsparameter and logic inStatistics.updateto downsample existing data and double the sampling interval once the number of collected points exceeds the configured limit. - Introduced
_filterDataPointsto uniformly subsampletimes,computer.curves, andprocess.curvesin sync. - Extended
Statisticsserialization/deserialization to persistmaxPoints,interval, and a newbaseIntervalattribute across sessions.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
91261e9 to
148b527
Compare
148b527 to
fbc941e
Compare
This pull request updates the
Statisticsclass inmeshroom/core/stats.pyto improve memory efficiency by limiting the number of stored data points and dynamically adjusting the sampling interval. The changes introduce a mechanism to filter and downsample collected statistics, ensuring that performance and memory usage remain stable over long-running sessions.Data retention and interval management improvements:
maxPointsparameter to theStatisticsclass to limit the number of stored data points and implemented logic inupdateto double the sampling interval and downsample the data when this limit is exceeded. [1] [2]_filterDataPointsmethod to efficiently downsample thetimes,computer.curves, andprocess.curvesdata structures when the maximum number of points is reached.maxPointsandbaseIntervalattributes to the class, and included them in serialization (toDict) and deserialization (fromDict) to ensure persistence across sessions. [1] [2]