Skip to content

Instantly share code, notes, and snippets.

@neonphog
Created February 10, 2020 16:59
Show Gist options
  • Select an option

  • Save neonphog/a2ad6ff0208515ada1a7e2a31a129433 to your computer and use it in GitHub Desktop.

Select an option

Save neonphog/a2ad6ff0208515ada1a7e2a31a129433 to your computer and use it in GitHub Desktop.
telegraf-example.bash
#!/bin/bash
# run this inside holochain-rust/crates/stress/
nix-env -f https://github.com/NixOS/nixpkgs-channels/archive/nixos-19.09.tar.gz -iA telegraf
cat > telegraf.toml <<'EOF'
[agent]
interval = "1s"
flush_interval = "1s"
[[outputs.file]]
files = ["stdout"]
data_format = "json"
#[[inputs.procstat]]
#pid_file = "stress.pid"
[[inputs.procstat]]
exe = "sim2h_stress"
[[inputs.procstat]]
exe = "cargo"
[[inputs.net]]
EOF
telegraf --config telegraf.toml &
TPID="${!}"
echo "RAN TELEGRAF WITH PID ${TPID}"
cargo run 2>&1 > /dev/null
kill ${TPID}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment