mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-08-18 12:08:22 +00:00
ci: add sqlness job (#835)
* ci: add sqlness job Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness to official release Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * filter out backtrace Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix error display Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * close once_cell feature gate Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -9,45 +9,52 @@ CREATE TABLE system_metrics (
|
||||
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.1, 70.3, 90.0, 1667446797450),
|
||||
("host1", "idc_b", 50.0, 66.7, 40.6, 1667446797450);
|
||||
|
||||
Affected Rows: 3
|
||||
|
||||
SELECT * FROM system_metrics;
|
||||
|
||||
+-----------------------+----------------------+----------------------------+-------------------------------+-----------------------------+----------------------------+
|
||||
| host, #Field, #String | idc, #Field, #String | cpu_util, #Field, #Float64 | memory_util, #Field, #Float64 | disk_util, #Field, #Float64 | ts, #Timestamp, #Timestamp |
|
||||
+-----------------------+----------------------+----------------------------+-------------------------------+-----------------------------+----------------------------+
|
||||
| host1 | idc_a | 11.8 | 10.3 | 10.3 | 1667446797450 |
|
||||
| host1 | idc_b | 50 | 66.7 | 40.6 | 1667446797450 |
|
||||
| host2 | idc_a | 80.1 | 70.3 | 90 | 1667446797450 |
|
||||
+-----------------------+----------------------+----------------------------+-------------------------------+-----------------------------+----------------------------+
|
||||
+-------+-------+----------+-------------+-----------+-------------------------+
|
||||
| host | idc | cpu_util | memory_util | disk_util | ts |
|
||||
+-------+-------+----------+-------------+-----------+-------------------------+
|
||||
| host1 | idc_a | 11.8 | 10.3 | 10.3 | 2022-11-03T03:39:57.450 |
|
||||
| host1 | idc_b | 50 | 66.7 | 40.6 | 2022-11-03T03:39:57.450 |
|
||||
| host2 | idc_a | 80.1 | 70.3 | 90 | 2022-11-03T03:39:57.450 |
|
||||
+-------+-------+----------+-------------+-----------+-------------------------+
|
||||
|
||||
SELECT count(*) FROM system_metrics;
|
||||
|
||||
+----------------------------------+
|
||||
| COUNT(UInt8(1)), #Field, #Uint64 |
|
||||
+----------------------------------+
|
||||
| 3 |
|
||||
+----------------------------------+
|
||||
+-----------------+
|
||||
| COUNT(UInt8(1)) |
|
||||
+-----------------+
|
||||
| 3 |
|
||||
+-----------------+
|
||||
|
||||
SELECT avg(cpu_util) FROM system_metrics;
|
||||
|
||||
+------------------------------------------------+
|
||||
| AVG(system_metrics.cpu_util), #Field, #Float64 |
|
||||
+------------------------------------------------+
|
||||
| 47.29999999999999 |
|
||||
+------------------------------------------------+
|
||||
+------------------------------+
|
||||
| AVG(system_metrics.cpu_util) |
|
||||
+------------------------------+
|
||||
| 47.29999999999999 |
|
||||
+------------------------------+
|
||||
|
||||
SELECT idc, avg(memory_util) FROM system_metrics GROUP BY idc ORDER BY idc;
|
||||
|
||||
+----------------------+---------------------------------------------------+
|
||||
| idc, #Field, #String | AVG(system_metrics.memory_util), #Field, #Float64 |
|
||||
+----------------------+---------------------------------------------------+
|
||||
| idc_a | 40.3 |
|
||||
| idc_b | 66.7 |
|
||||
+----------------------+---------------------------------------------------+
|
||||
+-------+---------------------------------+
|
||||
| idc | AVG(system_metrics.memory_util) |
|
||||
+-------+---------------------------------+
|
||||
| idc_a | 40.3 |
|
||||
| idc_b | 66.7 |
|
||||
+-------+---------------------------------+
|
||||
|
||||
DROP TABLE system_metrics;
|
||||
|
||||
Affected Rows: 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user