-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add schema for report upload counters
- Loading branch information
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE task_upload_counters; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- Per task report upload counters. | ||
CREATE TABLE task_upload_counters( | ||
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, -- artificial ID, internal-only | ||
task_id BIGINT NOT NULL, | ||
|
||
interval_collected BIGINT NOT NULL DEFAULT 0, -- Reports submitted for an interval that was already collected. | ||
report_decode_failure BIGINT NOT NULL DEFAULT 0, -- Reports which failed to decode. | ||
report_decrypt_failure BIGINT NOT NULL DEFAULT 0, -- Reports which failed to decrypt. | ||
report_expired BIGINT NOT NULL DEFAULT 0, -- Reports that were older than the task's report_expiry_age. | ||
report_outdated_key BIGINT NOT NULL DEFAULT 0, -- Reports that were encrypted with an unknown or outdated HPKE key. | ||
report_success BIGINT NOT NULL DEFAULT 0, -- Reports that were successfully uploaded. | ||
report_too_early BIGINT NOT NULL DEFAULT 0, -- Reports whose timestamp is too far in the future. | ||
task_expired BIGINT NOT NULL DEFAULT 0, -- Reports sent to the task while it is expired. | ||
|
||
ord BIGINT NOT NULL, -- Index of this task_upload_counters shard. | ||
|
||
CONSTRAINT fk_task_id FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE, | ||
CONSTRAINT task_upload_counters_unique UNIQUE(task_id, ord) | ||
); |