mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 06:34:03 +00:00
metrics: Fix metrics ts generator to treat numbers as decimals
Use bc tool to perform math operations even when variables contain values with leading zero. Fixes: #7317 Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
This commit is contained in:
parent
b6282f7053
commit
6924d14df5
@ -22,7 +22,7 @@ timestamp_ns() {
|
|||||||
t="$(date +%-s:%-N)"
|
t="$(date +%-s:%-N)"
|
||||||
s=$(echo $t | awk -F ':' '{print $1}')
|
s=$(echo $t | awk -F ':' '{print $1}')
|
||||||
n=$(echo $t | awk -F ':' '{print $2}')
|
n=$(echo $t | awk -F ':' '{print $2}')
|
||||||
ns=$(( (s * 1000000000) + n ))
|
ns=$(echo "$s * 1000000000 + $n" | bc)
|
||||||
|
|
||||||
echo $ns
|
echo $ns
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user