| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- SELECT id,prom FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 1, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 1, 1)
- **/
- ;
- SELECT id,prom.time('2024-09-27', '') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 18, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 24, 1)
- **/
- ;
- SELECT
- id,prom.date('2024-11-28').find(disk='/opt/matrix*')
- FROM
- /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 18, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 19, 1)
- **/;
- SELECT
- id,prom.date('2024-11-28').find(name="*key2*")
- FROM
- /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 18, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 19, 1)
- **/;
- SELECT id,prom.find(name='key2') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 4, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 7, 1)
- **/
- ;
- SELECT id, prom.date('2024-07-27') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecisen1", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecisen2", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 4, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 8, 1)
- **/
- ;
- SELECT id, prom.date('2024-07-28') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecisen1", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecisen2", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 4, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 4, 1)
- **/
- ;
- SELECT id, vtime, prom.date('2024-07-29') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecisen1", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecisen2", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 4, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 10, 1)
- **/
- ;
- SELECT id, prom.date('2024-07-30') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecisen1", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecisen2", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 4, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 11, 1)
- **/
- ;
- SELECT prom.date('2024-07-31') FROM /test/bucketpromdb where id='bucketpromdb:wecise'
- /**
- output()
- matchcount("prom.len", 6, 1)
- **/
- ;
- SELECT id,prom.time('2024-09-27') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise", "prom.len", 5, 1)
- **/
- ;
- SELECT id,prom.time('2024-07-26', '').find(name='key2') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 4, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 7, 1)
- **/
- ;
- -- 复杂查找用到了 lucene,得多等一会儿
- /**
- sleep(1s)
- **/
- ;
- SELECT id,prom.time('2024-07-26', '').find(name='keys2').find(value ~ '.*中文长字.*') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 3, 1)
- **/
- ;
- SELECT id,prom.time('2024-07-26', '').find(name='keys2').find(value = '这是中文长字符串ssstss') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 3, 1)
- **/
- ;
- SELECT id,prom.time('2024-07-26', '').find(name='keys1').find(value = 'ssst') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 0, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 3, 1)
- **/
- ;
- SELECT id,prom.time('2024-07-26', '').find(name='keys2').find(value !~ '.*中文长字a*') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise", "prom", null, 1)
- **/
- ;
- SELECT id,prom.time('2024-07-26', '').find(name='key1') FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 4, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 16, 1)
- **/
- ;
- -- SELECT id,prom.time('2024-07-26', '').find(name='key1').find(value = 2.9) FROM /test/bucketpromdb
- -- /**
- -- output()
- -- matchcount(id, "bucketpromdb:wecise11", "prom.len", 0, 1)
- -- matchcount(id, "bucketpromdb:wecise", "prom.len", 1, 1)
- -- **/
- -- ;
- -- SELECT id,prom.time('2024-07-26', '').find(name='key1').find(value >= 2.9) FROM /test/bucketpromdb
- -- /**
- -- output()
- -- matchcount(id, "bucketpromdb:wecise11", "prom.len", 4, 1)
- -- matchcount(id, "bucketpromdb:wecise", "prom.len", 7, 1)
- -- **/
- -- ;
- -- SELECT prom.time('2024-07-26', '').find(name='key1').find(value <= 2.9) FROM /test/bucketpromdb
- -- /**
- -- output()
- -- matchcount(id, "bucketpromdb:wecise11", "prom.len", 4, 1)
- -- matchcount(id, "bucketpromdb:wecise", "prom.len", 7, 1)
- -- **/
- -- ;
- select id,prom.time('2024-11-28 11:30', '2024-11-28 11:30').find(name='key1.key2.key4') from /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 1, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 1, 1)
- **/
- ;
- SELECT class, id, prom.time('2024-01-01', '').find(name ~ "key1.key2.*") FROM /test/bucketpromdb/
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 18, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 19, 1)
- **/
- ;
- SELECT id, prom.time('2024-07-24', '').find(name in ["key1"]).find(disk in ["/opt/matrix"]) FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.len", 3, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.len", 1, 1)
- **/
- ;
- -- SELECT id, prom_str.date('2024-07-31').find(value ~ 'info') FROM /test/promdb_string
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_str.date('2024-07-31').find(value !~ 'info') FROM /test/promdb_string
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_str.date('2024-07-31').find(value = '这是string测试') FROM /test/promdb_string
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_str.date('2024-07-31').find(value in ['这是string测试']) FROM /test/promdb_string
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_str.date('2024-07-31').find(value not like '这是string*') FROM /test/promdb_string
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_str.date('2024-07-31').find(value like '这是string*') FROM /test/promdb_string
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_str.date('2024-07-31').find(value like '这是string*').facet("info", "hello").groupby(1h) FROM /test/promdb_string
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_str.date('2024-07-31').find(value like '这是string*').facet("info", "hello").groupby(1h).outlier() FROM /test/promdb_string
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_str.date('2024-07-27', '2024-07-28', '2024-07-29', '2024-07-30', '2024-07-31').find(value like '这是string*').facet("error").groupby(1h) FROM /test/promdb_string
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_split.date('2024-07-31').time('11:27') FROM /test/bucketsplit
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_split.date('2024-07-26','2024-07-27','2024-07-28','2024-07-29','2024-07-30','2024-07-31') FROM /test/bucketsplit
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_split.date('2024-07-26','2024-07-27','2024-07-28','2024-07-29','2024-07-30','2024-07-31').avg().groupby(1d) FROM /test/bucketsplit
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_split.date('2024-07-26','2024-07-27','2024-07-28','2024-07-29','2024-07-30','2024-07-31').outlier() FROM /test/bucketsplit
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_split.date('2024-07-26','2024-07-27','2024-07-28','2024-07-29','2024-07-30','2024-07-31').time('11:').outlier() FROM /test/bucketsplit
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_split.date('2024-07-26').unit('avg') FROM /test/bucketsplit
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_split.date('2024-07-26','2024-07-27','2024-07-28','2024-07-29','2024-07-30','2024-07-31').sigma("count") FROM /test/bucketsplit
- -- /**
- -- output()
- -- **/
- -- ;
- -- SELECT id, prom_split.date('2024-07-26','2024-07-27','2024-07-28','2024-07-29','2024-07-30','2024-07-31').sigma("count", 1h) FROM /test/bucketsplit
- -- /**
- -- output()
- -- **/
- -- ;
- SELECT
- id, prom.time('2024-11-28 11:24:00', '2024-11-28 11:25:00').find(name='key1.key2.key3').sum()
- FROM
- /test/bucketpromdb where id='bucketpromdb:wecise11'
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.0.2", 2, 1)
- **/
- ;
- SELECT id, prom.date('2024-11-28').avg().sigma() FROM /test/bucketpromdb
- /**
- output()
- matchcount(id, "bucketpromdb:wecise11", "prom.0.2", 2.661111111111112, 1)
- matchcount(id, "bucketpromdb:wecise", "prom.0.5", 0.15630781478860528~0.1563078147886053, 1)
- **/
- ;
|