Extend sql schema. Add thresholds to metric schema

This commit is contained in:
Jan Eitzinger 2021-03-24 10:08:53 +01:00
parent aa5a3daff3
commit d3833cd5f2
3 changed files with 25 additions and 5 deletions

View File

@ -9,4 +9,6 @@ The specifications are defined following the [OpenAPI Initiative](https://www.op
Main data exchange format is JSON. Main data exchange format is JSON.
The specifications are defined following the [JSON schema](https://json-schema.org) format standard. The specifications are defined following the [JSON schema](https://json-schema.org) format standard.
## Database schemas ## Database schema
Recommended minimal SQL database schema for job meta data.

View File

@ -21,6 +21,24 @@
"description": "Measurement interval in seconds", "description": "Measurement interval in seconds",
"type": "integer" "type": "integer"
}, },
"thresholds": {
"description": "Metric thresholds for specific system",
"type": "object",
"properties": {
"peak": {
"type": "number"
},
"normal": {
"type": "number"
},
"caution": {
"type": "number"
},
"alert": {
"type": "number"
}
}
},
"series": { "series": {
"description": "", "description": "",
"type": "array", "type": "array",

View File

@ -1,9 +1,9 @@
CREATE TABLE job ( id INTEGER PRIMARY KEY, CREATE TABLE job ( id INTEGER PRIMARY KEY,
job_id TEXT, user_id TEXT, project_id TEXT, cluster_id TEXT, job_id TEXT NOT NULL, user_id TEXT NOT NULL, project_id TEXT NOT NULL, cluster_id TEXT NOT NULL,
start_time INTEGER, duration INTEGER, start_time INTEGER NOT NULL, duration INTEGER NOT NULL,
walltime INTEGER, job_state TEXT, walltime INTEGER, job_state TEXT,
num_nodes INTEGER, node_list TEXT, has_profile INTEGER, num_nodes INTEGER NOT NULL, node_list TEXT NOT NULL, has_profile INTEGER NOT NULL,
mem_used_max REAL, flops_any_avg REAL, mem_bw_avg REAL, net_bw_avg REAL, file_bw_avg REAL); mem_used_max REAL, flops_any_avg REAL, mem_bw_avg REAL, load_avg REAL, net_bw_avg REAL, file_bw_avg REAL);
CREATE TABLE tag ( id INTEGER PRIMARY KEY, tag_type TEXT, tag_name TEXT); CREATE TABLE tag ( id INTEGER PRIMARY KEY, tag_type TEXT, tag_name TEXT);
CREATE TABLE jobtag ( job_id INTEGER, tag_id INTEGER, PRIMARY KEY (job_id, tag_id), CREATE TABLE jobtag ( job_id INTEGER, tag_id INTEGER, PRIMARY KEY (job_id, tag_id),
FOREIGN KEY (job_id) REFERENCES job (id) ON DELETE CASCADE ON UPDATE NO ACTION, FOREIGN KEY (job_id) REFERENCES job (id) ON DELETE CASCADE ON UPDATE NO ACTION,