1 # This test runs victoriametrics and checks if victoriametrics is able to write points and run simple query
3 import ./make-test-python.nix (
6 name = "victoriametrics";
7 meta = with pkgs.lib.maintainers; {
18 services.victoriametrics.enable = true;
25 one.wait_for_unit("victoriametrics.service")
27 # write some points and run simple query
29 "curl -f -d 'measurement,tag1=value1,tag2=value2 field1=123,field2=1.23' -X POST 'http://localhost:8428/write'"
32 """curl -f -s -G 'http://localhost:8428/api/v1/export' -d 'match={__name__!=""}'"""
34 # data takes a while to appear
35 one.wait_until_succeeds(f"[[ $({cmd} | wc -l) -ne 0 ]]")
36 out = one.succeed(cmd)
37 assert '"values":[123]' in out
38 assert '"values":[1.23]' in out