This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
CREATE TABLE capacity_samples (
|
||||
entity_kind text NOT NULL CHECK (entity_kind IN ('share', 'pool', 'disk')),
|
||||
entity_id text NOT NULL CHECK (length(entity_id) BETWEEN 1 AND 128),
|
||||
entity_name text NOT NULL CHECK (length(entity_name) BETWEEN 1 AND 255),
|
||||
source_id text NOT NULL CHECK (length(source_id) BETWEEN 1 AND 128),
|
||||
sampled_at timestamptz NOT NULL,
|
||||
observed_at timestamptz NOT NULL,
|
||||
used_bytes bigint NOT NULL CHECK (used_bytes >= 0),
|
||||
capacity_bytes bigint NOT NULL CHECK (capacity_bytes >= 0),
|
||||
PRIMARY KEY (entity_kind, entity_id, source_id, sampled_at)
|
||||
);
|
||||
|
||||
CREATE INDEX capacity_samples_history_idx
|
||||
ON capacity_samples (entity_kind, entity_id, sampled_at DESC);
|
||||
Reference in New Issue
Block a user