2017-09-30 19:12:24 +00:00
|
|
|
import ./make-test.nix ({ pkgs, ...} :
|
|
|
|
{
|
|
|
|
name = "graphite";
|
|
|
|
nodes = {
|
|
|
|
one =
|
|
|
|
{ config, pkgs, ... }: {
|
2017-10-31 14:49:59 +00:00
|
|
|
time.timeZone = "UTC";
|
2017-09-30 19:12:24 +00:00
|
|
|
services.graphite = {
|
2017-10-31 14:49:59 +00:00
|
|
|
web.enable = true;
|
|
|
|
api = {
|
2017-09-30 19:12:24 +00:00
|
|
|
enable = true;
|
2017-10-31 14:49:59 +00:00
|
|
|
port = 8082;
|
2017-09-30 19:12:24 +00:00
|
|
|
};
|
2017-10-31 14:49:59 +00:00
|
|
|
carbon.enableCache = true;
|
|
|
|
seyren.enable = true;
|
|
|
|
pager.enable = true;
|
2017-09-30 19:12:24 +00:00
|
|
|
};
|
|
|
|
};
|
2017-10-31 14:49:59 +00:00
|
|
|
};
|
2017-09-30 19:12:24 +00:00
|
|
|
|
|
|
|
testScript = ''
|
|
|
|
startAll;
|
|
|
|
$one->waitForUnit("default.target");
|
|
|
|
$one->requireActiveUnit("graphiteWeb.service");
|
2017-10-31 14:49:59 +00:00
|
|
|
$one->requireActiveUnit("graphiteApi.service");
|
|
|
|
$one->requireActiveUnit("graphitePager.service");
|
2017-09-30 19:12:24 +00:00
|
|
|
$one->requireActiveUnit("carbonCache.service");
|
2017-10-31 14:49:59 +00:00
|
|
|
$one->requireActiveUnit("seyren.service");
|
2017-09-30 19:12:24 +00:00
|
|
|
$one->succeed("echo \"foo 1 `date +%s`\" | nc -q0 localhost 2003");
|
|
|
|
$one->waitUntilSucceeds("curl 'http://localhost:8080/metrics/find/?query=foo&format=treejson' --silent | grep foo")
|
|
|
|
'';
|
|
|
|
})
|