| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- -- ============================================================
- -- bucket promdb 测试
- -- ============================================================
- -- 1. 插入数据到 promdb
- insert into /test/aaa/test_bucket_promdb (name, metric, ts) values ('prom_001', 1.5, 1700000000000)
- ;
- insert into /test/aaa/test_bucket_promdb (name, metric, ts) values ('prom_002', 2.5, 1700000001000)
- ;
- insert into /test/aaa/test_bucket_promdb (name, metric, ts) values ('prom_003', 3.5, 1700000002000)
- ;
- -- 2. 查询 promdb
- select * from /test/aaa/test_bucket_promdb where name='prom_001'
- /**
- output()
- count(1)
- **/
- ;
- -- 3. 全表查询
- select name, metric, ts from /test/aaa/test_bucket_promdb
- /**
- output()
- **/
- ;
- -- 4. 更新 promdb
- update /test/aaa/test_bucket_promdb set metric=10.5 where name='prom_001'
- ;
- select name, metric from /test/aaa/test_bucket_promdb where name='prom_001'
- /**
- output()
- match("metric","10.5")
- **/
- ;
- -- 5. 聚合 promdb
- select count(*) from /test/aaa/test_bucket_promdb
- /**
- output()
- **/
- ;
- -- 6. delete promdb
- delete from /test/aaa/test_bucket_promdb where name='prom_003'
- ;
- select count(*) from /test/aaa/test_bucket_promdb
- /**
- output()
- **/
- ;
|