-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nixos/victoriametrics: harden systemd unit, add more options.
- Loading branch information
Showing
2 changed files
with
190 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,41 @@ | ||
# This test runs influxdb and checks if influxdb is up and running | ||
# This test runs victoriametrics and checks if victoriametrics is able to write points and run simple query | ||
|
||
import ./make-test-python.nix ({ pkgs, ...} : { | ||
name = "victoriametrics"; | ||
meta = with pkgs.lib.maintainers; { | ||
maintainers = [ yorickvp ]; | ||
}; | ||
import ./make-test-python.nix ( | ||
{ pkgs, ... }: | ||
{ | ||
name = "victoriametrics"; | ||
meta = with pkgs.lib.maintainers; { | ||
maintainers = [ | ||
yorickvp | ||
ryan4yin | ||
]; | ||
}; | ||
|
||
nodes = { | ||
one = { ... }: { | ||
services.victoriametrics.enable = true; | ||
nodes = { | ||
one = | ||
{ ... }: | ||
{ | ||
services.victoriametrics.enable = true; | ||
}; | ||
}; | ||
}; | ||
|
||
testScript = '' | ||
start_all() | ||
testScript = '' | ||
start_all() | ||
one.wait_for_unit("victoriametrics.service") | ||
one.wait_for_unit("victoriametrics.service") | ||
# write some points and run simple query | ||
out = one.succeed( | ||
"curl -f -d 'measurement,tag1=value1,tag2=value2 field1=123,field2=1.23' -X POST 'http://localhost:8428/write'" | ||
) | ||
cmd = ( | ||
"""curl -f -s -G 'http://localhost:8428/api/v1/export' -d 'match={__name__!=""}'""" | ||
) | ||
# data takes a while to appear | ||
one.wait_until_succeeds(f"[[ $({cmd} | wc -l) -ne 0 ]]") | ||
out = one.succeed(cmd) | ||
assert '"values":[123]' in out | ||
assert '"values":[1.23]' in out | ||
''; | ||
}) | ||
# write some points and run simple query | ||
out = one.succeed( | ||
"curl -f -d 'measurement,tag1=value1,tag2=value2 field1=123,field2=1.23' -X POST 'http://localhost:8428/write'" | ||
) | ||
cmd = ( | ||
"""curl -f -s -G 'http://localhost:8428/api/v1/export' -d 'match={__name__!=""}'""" | ||
) | ||
# data takes a while to appear | ||
one.wait_until_succeeds(f"[[ $({cmd} | wc -l) -ne 0 ]]") | ||
out = one.succeed(cmd) | ||
assert '"values":[123]' in out | ||
assert '"values":[1.23]' in out | ||
''; | ||
} | ||
) |