This is a list of UTs to cover very basic query scenarios. It is not complete, to be added. Two issues are reported at the end of the ticket.
-
Add a data point with 2 tags.
[Yi-MBP /]$ curl -XPOST 'http://192.168.1.41:6182/api/put' -d 'put test.cpu.idle 1679757000 100 host=aaa cpu=0'
-
m=avg:1m-avg:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=avg:1m-avg:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":100.0}}]
-
m=avg:1m-sum:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=avg:1m-sum:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":100.0}}]
-
m=avg:1m-count:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=avg:1m-count:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":1.0}}]
-
m=sum:1m-avg:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=sum:1m-avg:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":100.0}}]
-
m=sum:1m-sum:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=sum:1m-sum:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":100.0}}]
-
m=sum:1m-count:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=sum:1m-count:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":1.0}}]
-
m=count:1m-avg:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=count:1m-avg:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":1.0}}]
-
m=count:1m-sum:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=count:1m-sum:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":1.0}}]
-
m=count:1m-count:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=count:1m-count:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":1.0}}]
-
m=avg:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=avg:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":100.0}}]
-
m=sum:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=sum:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":100.0}}]
-
m=count:test.cpu.idle{host=aaa,cpu=0}
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=count:test.cpu.idle\{host=aaa,cpu=0\}' [{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":1.0}}]
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=coun:test.cpu.idle\{host=aaa,cpu=0\}'
[{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":1.0}}]
[Yi-MBP ~]$ curl 'http://192.168.1.41:6182/api/query?start=1679757000&end=1679757700&m=count2:test.cpu.idle\{host=aaa,cpu=0\}'
[{"metric":"test.cpu.idle","tags":{"cpu":"0","host":"aaa"},"aggregateTags":[],"dps":{"1679757000":1.0}}]