Commit 7ea93eb5 authored by Dominika Liberda's avatar Dominika Liberda 💽
Browse files

* fixes data duplicates in graph rendering

parent bf4dadd8
......@@ -15,6 +15,7 @@ start_date="$(jq -r '.date' < $data | tail -n $lim | head -n1)"
end_date="$(jq -r '.date' < $data | tail -n1)"
tmp="$(mktemp)"
type="$(jq -r '.type' < $data | head -n 1)"
a=''
if [[ "$type" == "ping" ]]; then
timedata="$(jq -r '.time' < $data | tail -n $lim)"
......@@ -39,10 +40,10 @@ elif [[ "$type" == "req" ]]; then
done <<< "$(jq -r '"Name: \(.label)\\\\nDate: \(.date)"' < "$data" | tail -n $lim)" > $tmp
elif [[ "$type" == "port" ]]; then
timedata="$(jq -r '.status' < $data | tail -n $lim)"
for i in $timedata; do
if [[ "$i" -gt 0 ]]; then
for ii in $timedata; do
if [[ "$ii" -gt 0 ]]; then
a="${a}0#"
elif [[ "$i" == 0 ]]; then
elif [[ "$ii" == 0 ]]; then
a="${a}1#"
fi
done
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment