Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #21 from hacker-h/add-ping-chart
Browse files Browse the repository at this point in the history
Add ping chart
  • Loading branch information
Pedro César de Azevedo authored Jul 15, 2021
2 parents 3db68c5 + 3980c74 commit 43d6bf6
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 1 deletion.
4 changes: 3 additions & 1 deletion speedtest/scripts/init_test_connection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ do

DOWNLOAD=$(cat $FILE | grep "Download:" | awk -F " " '{print $2}')
UPLOAD=$(cat $FILE | grep "Upload:" | awk -F " " '{print $2}')
echo "Download: $DOWNLOAD Upload: $UPLOAD $TIMESTAMP"
PING=$(ping -qc1 google.com 2>&1 | awk -F'/' 'END {print (/^round-trip/? $4:"-100")}')
echo "Download: $DOWNLOAD Upload: $UPLOAD Ping: $PING $TIMESTAMP"
curl -i -XPOST 'http://db:8086/write?db=speedtest' --data-binary "download,host=local value=$DOWNLOAD"
curl -i -XPOST 'http://db:8086/write?db=speedtest' --data-binary "upload,host=local value=$UPLOAD"
curl -i -XPOST 'http://db:8086/write?db=speedtest' --data-binary "ping,host=local value=$PING"
sleep $TEST_INTERVAL

done
123 changes: 123 additions & 0 deletions speedweb/conf/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,127 @@
"title": "Row",
"collapse": false,
"editable": true
},
{
"height": "610px",
"panels": [
{
"title": "Ping",
"error": false,
"span": 12,
"editable": true,
"type": "graph",
"yaxes": [
{
"show": true,
"min": null,
"max": null,
"logBase": 1,
"format": "ms"
},
{
"show": true,
"min": null,
"max": null,
"logBase": 1,
"format": "ms"
}
],
"isNew": true,
"id": 3,
"datasource": "InfluxDB",
"renderer": "flot",
"x-axis": true,
"y-axis": true,
"y_formats": [
"ms",
"ms"
],
"grid": {
"leftLogBase": 1,
"leftMax": null,
"rightMax": null,
"leftMin": null,
"rightMin": null,
"rightLogBase": 1,
"threshold1": null,
"threshold2": null,
"threshold1Color": "rgba(216, 200, 27, 0.27)",
"threshold2Color": "rgba(234, 112, 112, 0.22)"
},
"lines": true,
"fill": 1,
"linewidth": 2,
"points": false,
"pointradius": 5,
"bars": false,
"stack": false,
"percentage": false,
"legend": {
"show": true,
"values": false,
"min": false,
"max": false,
"current": false,
"total": false,
"avg": false
},
"nullPointMode": "connected",
"steppedLine": false,
"tooltip": {
"value_type": "cumulative",
"shared": true
},
"timeFrom": null,
"timeShift": null,
"targets": [
{
"refId": "A",
"dsType": "influxdb",
"resultFormat": "time_series",
"tags": [],
"groupBy": [
{
"type": "time",
"params": [
"$interval"
]
},
{
"type": "fill",
"params": [
"null"
]
}
],
"select": [
[
{
"type": "field",
"params": [
"value"
]
},
{
"type": "mean",
"params": []
}
]
],
"alias": "Ping",
"measurement": "ping",
"query": "SELECT mean(\"value\") FROM \"ping\" WHERE $timeFilter GROUP BY time($interval) fill(null)"
}
],
"aliasColors": {},
"seriesOverrides": [],
"links": [],
"height": "250px"
}
],
"title": "Row",
"collapse": false,
"editable": true
}
],
"time": {
Expand All @@ -260,6 +381,8 @@
"enable": false,
"type": "timepicker",
"time_options": [
"30s",
"1m",
"5m",
"15m",
"1h",
Expand Down

0 comments on commit 43d6bf6

Please sign in to comment.