* fixes data duplicates in graph rendering
This commit is contained in:
parent
bf4dadd8d6
commit
7ea93eb50c
|
@ -15,6 +15,7 @@ start_date="$(jq -r '.date' < $data | tail -n $lim | head -n1)"
|
||||||
end_date="$(jq -r '.date' < $data | tail -n1)"
|
end_date="$(jq -r '.date' < $data | tail -n1)"
|
||||||
tmp="$(mktemp)"
|
tmp="$(mktemp)"
|
||||||
type="$(jq -r '.type' < $data | head -n 1)"
|
type="$(jq -r '.type' < $data | head -n 1)"
|
||||||
|
a=''
|
||||||
|
|
||||||
if [[ "$type" == "ping" ]]; then
|
if [[ "$type" == "ping" ]]; then
|
||||||
timedata="$(jq -r '.time' < $data | tail -n $lim)"
|
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
|
done <<< "$(jq -r '"Name: \(.label)\\\\nDate: \(.date)"' < "$data" | tail -n $lim)" > $tmp
|
||||||
elif [[ "$type" == "port" ]]; then
|
elif [[ "$type" == "port" ]]; then
|
||||||
timedata="$(jq -r '.status' < $data | tail -n $lim)"
|
timedata="$(jq -r '.status' < $data | tail -n $lim)"
|
||||||
for i in $timedata; do
|
for ii in $timedata; do
|
||||||
if [[ "$i" -gt 0 ]]; then
|
if [[ "$ii" -gt 0 ]]; then
|
||||||
a="${a}0#"
|
a="${a}0#"
|
||||||
elif [[ "$i" == 0 ]]; then
|
elif [[ "$ii" == 0 ]]; then
|
||||||
a="${a}1#"
|
a="${a}1#"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue