reading data
from file /tmp/netmetr-history.json
If missing display []
json looks like this:
{
"error": [],
"history": [
{
"speed_download": "180",
"speed_upload": "170",
"ping_shortest_classification": 3,
"test_type_id": 1,
"speed_download_classification": 3,
"ping": "0.49",
"ping_shortest": "0.49",
"time_string": "Nov 14, 2017 10:57:32 AM",
"speed_upload_classification": 3,
"time": 1510653452000,
"ping_classification": 3,
"timezone": "CET",
"model": "Turris",
"test_uuid": "947ca607-ac0b-42f1-b358-fc9a9078fe02",
"network_type": "LAN"
},
{
"speed_download": "180",
"speed_upload": "170",
"ping_shortest_classification": 3,
"test_type_id": 1,
"speed_download_classification": 3,
"ping": "0.52",
"ping_shortest": "0.52",
"time_string": "Nov 14, 2017 10:42:37 AM",
"speed_upload_classification": 3,
"time": 1510652557000,
"ping_classification": 3,
"timezone": "CET",
"model": "Turris",
"test_uuid": "75a2b5e3-3371-4e7b-99a3-9ee2f7e6d7ff",
"network_type": "LAN"
}
]
}
or on error:
{
"error": [
"Could not find history in database."
],
"history": []
}
When an error is set the history will be empty