Skip to content

Instantly share code, notes, and snippets.

@torkelo
Created May 26, 2021 18:35
Show Gist options
  • Save torkelo/bd91b3aa0d27618e010ee54c30452b43 to your computer and use it in GitHub Desktop.
Save torkelo/bd91b3aa0d27618e010ee54c30452b43 to your computer and use it in GitHub Desktop.
Grafana live streaming
#!/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