-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
0 deletions.
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
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,43 @@ | ||
-- SQLNESS ARG version=v0.9.5 | ||
CREATE TABLE system_metrics ( | ||
host STRING, | ||
idc STRING, | ||
cpu_util DOUBLE, | ||
memory_util DOUBLE, | ||
disk_util DOUBLE, | ||
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP(), | ||
PRIMARY KEY(host, idc), | ||
TIME INDEX(ts) | ||
); | ||
|
||
Affected Rows: 0 | ||
|
||
INSERT INTO system_metrics | ||
VALUES | ||
("host1", "idc_a", 11.8, 10.3, 10.3, 1667446797450), | ||
("host2", "idc_a", 80.0, 70.3, 90.0, 1667446797450), | ||
("host1", "idc_b", 50.0, 66.7, 40.6, 1667446797450); | ||
|
||
Affected Rows: 3 | ||
|
||
-- SQLNESS ARG version=latest | ||
SHOW CREATE TABLE system_metrics; | ||
|
||
+----------------+-----------------------------------------------------------+ | ||
| Table | Create Table | | ||
+----------------+-----------------------------------------------------------+ | ||
| system_metrics | CREATE TABLE IF NOT EXISTS "system_metrics" ( | | ||
| | "host" STRING NULL, | | ||
| | "idc" STRING NULL, | | ||
| | "cpu_util" DOUBLE NULL, | | ||
| | "memory_util" DOUBLE NULL, | | ||
| | "disk_util" DOUBLE NULL, | | ||
| | "ts" TIMESTAMP(3) NOT NULL DEFAULT current_timestamp(), | | ||
| | TIME INDEX ("ts"), | | ||
| | PRIMARY KEY ("host", "idc") | | ||
| | ) | | ||
| | | | ||
| | ENGINE=mito | | ||
| | | | ||
+----------------+-----------------------------------------------------------+ | ||
|
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,20 @@ | ||
-- SQLNESS ARG version=v0.9.5 | ||
CREATE TABLE system_metrics ( | ||
host STRING, | ||
idc STRING, | ||
cpu_util DOUBLE, | ||
memory_util DOUBLE, | ||
disk_util DOUBLE, | ||
ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP(), | ||
PRIMARY KEY(host, idc), | ||
TIME INDEX(ts) | ||
); | ||
|
||
INSERT INTO system_metrics | ||
VALUES | ||
("host1", "idc_a", 11.8, 10.3, 10.3, 1667446797450), | ||
("host2", "idc_a", 80.0, 70.3, 90.0, 1667446797450), | ||
("host1", "idc_b", 50.0, 66.7, 40.6, 1667446797450); | ||
|
||
-- SQLNESS ARG version=latest | ||
SHOW CREATE TABLE system_metrics; |