Created
May 26, 2021 18:35
-
-
Save torkelo/bd91b3aa0d27618e010ee54c30452b43 to your computer and use it in GitHub Desktop.
Grafana live streaming
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
#!/bin/bash | |
value=50 | |
while true; do | |
value=$(( value + (RANDOM % 10) -5 )) | |
if ((value >= 100)); then | |
value=100 | |
fi | |
if ((value <= 0)); then | |
value=0 | |
fi | |
echo $value | |
curl -POST http://localhost:3000/api/live/push/example -d "system,device=SensorA value=$value" | |
sleep 0.05 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment