From e0d7c7697bc1ef7b9aab66eee232c838654611dd Mon Sep 17 00:00:00 2001 From: Lup Yuen Lee Date: Tue, 22 Oct 2024 13:04:21 +0800 Subject: [PATCH] Add total job hours --- compute-github-runners.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compute-github-runners.sh b/compute-github-runners.sh index 50a7576..93ba17f 100755 --- a/compute-github-runners.sh +++ b/compute-github-runners.sh @@ -45,6 +45,9 @@ function add_runner_hours { fi ## Extrapolate the Job Duration to Runner Hours + total_job_hours=$( + bc -l -e "$total_job_hours+($run_duration_ms/1000/60/60)" + ) local runner_hours=$( bc -e "$duration_hours_to_runner_hours*$run_duration_ms/1000/60/60" ) @@ -58,6 +61,7 @@ function add_runner_hours { ## Accumulate the Runner Hours for nuttx and nuttx-apps repos echo run_id,run_duration_ms,runner_hours +total_job_hours=0 total_runner_hours=0 add_runner_hours apache/nuttx add_runner_hours apache/nuttx-apps @@ -66,7 +70,11 @@ add_runner_hours apache/nuttx-apps fulltime_runners=$( bc -e "$total_runner_hours/$hours" ) +total_job_hours=$( + bc -l -e "r($total_job_hours,1)" +) echo date=$date echo hours=$hours +echo total_job_hours=$total_job_hours echo total_runner_hours=$total_runner_hours echo fulltime_runners=$fulltime_runners