mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-17 15:38:00 +00:00
Merge pull request #7318 from dborquez/fix_timestamp_generator_on_metrics
metrics: Fix metrics ts generator to treat numbers as decimals
This commit is contained in:
commit
8db43eae44
@ -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