(core) Enforcing data size limit

Summary:
Track 'data size' in ActiveDoc alongside row count. Measure it at most once every 5 minutes after each change as before, or after every change when it becomes high enough to matter.

A document is now considered to be approaching/exceeding 'the data limit' if either the data size or the row count is approaching/exceeding its own limit.

Unrelated: tweaked teamFreeFeatures.snapshotWindow based on Quip comments

Test Plan: Tested manually that data size is now logged after every change once it gets high enough, but only if the row limit isn't also too high. Still too early for automated tests.

Reviewers: georgegevoian

Reviewed By: georgegevoian

Differential Revision: https://phab.getgrist.com/D3341
This commit is contained in:
Alex Hall
2022-03-30 13:45:37 +02:00
parent 8269c33d01
commit 21b0ac3eff
5 changed files with 105 additions and 52 deletions

View File

@@ -1,6 +1,6 @@
export interface SnapshotWindow {
count: number;
unit: 'month' | 'year';
unit: 'days' | 'month' | 'year';
}
// A product is essentially a list of flags and limits that we may enforce/support.
@@ -46,6 +46,7 @@ export interface Features {
// number of rows (total) in a single document.
// Actual max for a document may be higher.
baseMaxApiUnitsPerDocumentPerDay?: number; // Similar for api calls.
baseMaxDataSizePerDocument?: number; // Similar maximum for number of bytes of 'normal' data in a document
gracePeriodDays?: number; // Duration of the grace period in days, before entering delete-only mode
}