Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,15 @@ export default {
}
}
}

// Enforce pointsSaved limit - remove oldest data points if exceeded
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs hysterisis such that every new sample doesn't require rebuilding the array.
Basically check from setting + 100 data points, and then do the cut back to the limit.

if (this.pointsSaved > 0 && this.data[0].length > this.pointsSaved) {
const pointsToRemove = this.data[0].length - this.pointsSaved
for (let j = 0; j < this.data.length; j++) {
this.data[j].splice(0, pointsToRemove)
}
}

// If we weren't passed a startTime notify grapher of our start
if (this.startTime == null && this.data[0][0]) {
let newStartTime = this.data[0][0] * 1_000_000_000
Expand Down
Loading