X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjob-cost.sh;h=4648a9538de91381f312a5a1762526a60726cafa;hb=f1965ead65dbec24eafddcd6e59c793406a4c099;hp=dde312984aca113632d16f80091d7b7a627d7ab7;hpb=1024ff22b0f0009077227a3b5bfff119beeb4bd1;p=releng%2Fglobal-jjb.git diff --git a/shell/job-cost.sh b/shell/job-cost.sh index dde31298..4648a953 100644 --- a/shell/job-cost.sh +++ b/shell/job-cost.sh @@ -53,9 +53,8 @@ else fi # Retrieve the current uptime (in seconds) -uptime=$(awk '{print $1}' /proc/uptime) -# Convert to integer by truncating fractional part' and round up by one -((uptime=${uptime%\.*}+1)) +# And Convert to integer by truncating fractional part' and round up by one +uptime=$(awk '{print int($1 + 1)}' /proc/uptime) # EC2 and OpenStack have simiar instace metadata APIs at this IP # AWS docs: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html