mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 13:22:57 +00:00
82 lines
3.1 KiB
Plaintext
82 lines
3.1 KiB
Plaintext
create table cache_hit (
|
|
ts timestamp time index,
|
|
job string,
|
|
greptime_value double,
|
|
primary key (job)
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
insert into cache_hit values
|
|
(3000, "read", 123.45),
|
|
(3000, "write", 234.567),
|
|
(4000, "read", 345.678),
|
|
(4000, "write", 456.789);
|
|
|
|
Affected Rows: 4
|
|
|
|
-- SQLNESS SORT_RESULT 3 1
|
|
tql eval (3, 4, '1s') round(cache_hit, 0.01);
|
|
|
|
+---------------------+----------------------------+-------+
|
|
| ts | prom_round(greptime_value) | job |
|
|
+---------------------+----------------------------+-------+
|
|
| 1970-01-01T00:00:03 | 123.45 | read |
|
|
| 1970-01-01T00:00:03 | 234.57 | write |
|
|
| 1970-01-01T00:00:04 | 345.68 | read |
|
|
| 1970-01-01T00:00:04 | 456.79 | write |
|
|
+---------------------+----------------------------+-------+
|
|
|
|
-- SQLNESS SORT_RESULT 3 1
|
|
tql eval (3, 4, '1s') round(cache_hit, 0.1);
|
|
|
|
+---------------------+----------------------------+-------+
|
|
| ts | prom_round(greptime_value) | job |
|
|
+---------------------+----------------------------+-------+
|
|
| 1970-01-01T00:00:03 | 123.5 | read |
|
|
| 1970-01-01T00:00:03 | 234.60000000000002 | write |
|
|
| 1970-01-01T00:00:04 | 345.70000000000005 | read |
|
|
| 1970-01-01T00:00:04 | 456.8 | write |
|
|
+---------------------+----------------------------+-------+
|
|
|
|
-- SQLNESS SORT_RESULT 3 1
|
|
tql eval (3, 4, '1s') round(cache_hit, 1.0);
|
|
|
|
+---------------------+----------------------------+-------+
|
|
| ts | prom_round(greptime_value) | job |
|
|
+---------------------+----------------------------+-------+
|
|
| 1970-01-01T00:00:03 | 123.0 | read |
|
|
| 1970-01-01T00:00:03 | 235.0 | write |
|
|
| 1970-01-01T00:00:04 | 346.0 | read |
|
|
| 1970-01-01T00:00:04 | 457.0 | write |
|
|
+---------------------+----------------------------+-------+
|
|
|
|
-- SQLNESS SORT_RESULT 3 1
|
|
tql eval (3, 4, '1s') round(cache_hit);
|
|
|
|
+---------------------+----------------------------+-------+
|
|
| ts | prom_round(greptime_value) | job |
|
|
+---------------------+----------------------------+-------+
|
|
| 1970-01-01T00:00:03 | 123.0 | read |
|
|
| 1970-01-01T00:00:03 | 235.0 | write |
|
|
| 1970-01-01T00:00:04 | 346.0 | read |
|
|
| 1970-01-01T00:00:04 | 457.0 | write |
|
|
+---------------------+----------------------------+-------+
|
|
|
|
-- SQLNESS SORT_RESULT 3 1
|
|
tql eval (3, 4, '1s') round(cache_hit, 10.0);
|
|
|
|
+---------------------+----------------------------+-------+
|
|
| ts | prom_round(greptime_value) | job |
|
|
+---------------------+----------------------------+-------+
|
|
| 1970-01-01T00:00:03 | 120.0 | read |
|
|
| 1970-01-01T00:00:03 | 230.0 | write |
|
|
| 1970-01-01T00:00:04 | 350.0 | read |
|
|
| 1970-01-01T00:00:04 | 460.0 | write |
|
|
+---------------------+----------------------------+-------+
|
|
|
|
drop table cache_hit;
|
|
|
|
Affected Rows: 0
|
|
|