Skip to content

Commit

Permalink
Adding time to total-data.json and lap-data.json (#60)
Browse files Browse the repository at this point in the history
* Add time as a parameter to total-data.json

* Add time parameter parsing

* Fix typo

* Add debugging lines

* Fix typo

* Remove debugging lines

* Add time as parameter in make_measurement

* Fix typo
  • Loading branch information
nstruharova authored Feb 23, 2024
1 parent 29d49af commit 2aac9aa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion scripts/add-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LABEL=""
CPU=""
ENERGY=""
POWER=""
TIME=""

# Parse named parameters
while [[ $# -gt 0 ]]; do
Expand Down Expand Up @@ -37,6 +38,11 @@ while [[ $# -gt 0 ]]; do
shift # past argument
shift # past value
;;
-t|--time)
TIME="$2"
shift # past argument
shift # past value
;;
*) # unknown option
echo "Unknown option: $1"
exit 1
Expand All @@ -55,7 +61,8 @@ NEW_STEP=$(cat <<EOM
"label": "$LABEL",
"cpu_avg_percent": "$CPU",
"energy_joules": "$ENERGY",
"power_avg_watts": "$POWER"
"power_avg_watts": "$POWER",
"time": "$TIME"
}
EOM
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/display_results.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function display_results {
echo "show create-and-add-meta.sh output"
echo "--file $total_data_file --repository $repo_enc --branch $branch_enc --workflow $WORKFLOW_ID --run_id $run_id_enc"
source "$(dirname "$0")/create-and-add-meta.sh" --file "${total_data_file}" --repository "${repo_enc}" --branch "${branch_enc}" --workflow "$WORKFLOW_ID" --run_id "${run_id_enc}"
source "$(dirname "$0")/add-data.sh" --file "${total_data_file}" --label "TOTAL" --cpu "${cpu_avg}" --energy "${total_energy}" --power "${power_avg}"
source "$(dirname "$0")/add-data.sh" --file "${total_data_file}" --label "TOTAL" --cpu "${cpu_avg}" --energy "${total_energy}" --power "${power_avg}" --time "${time}"

}

Expand Down
2 changes: 1 addition & 1 deletion scripts/make_measurement.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function make_measurement() {
echo "--file $lap_data_file --repository $repo_enc --branch $branch_enc --workflow $WORKFLOW_ID --run_id $run_id_enc"

source "$(dirname "$0")/create-and-add-meta.sh" --file "${lap_data_file}" --repository "${repo_enc}" --branch "${branch_enc}" --workflow "$WORKFLOW_ID" --run_id "${run_id_enc}"
source "$(dirname "$0")/add-data.sh" --file "${lap_data_file}" --label "$label" --cpu "${cpu_avg}" --energy "${total_energy}" --power "${power_avg}"
source "$(dirname "$0")/add-data.sh" --file "${lap_data_file}" --label "$label" --cpu "${cpu_avg}" --energy "${total_energy}" --power "${power_avg}" --time "${time}"

killall -9 -q /tmp/eco-ci/demo-reporter || true
/tmp/eco-ci/demo-reporter | tee -a /tmp/eco-ci/cpu-util-total.txt > /tmp/eco-ci/cpu-util.txt &
Expand Down

0 comments on commit 2aac9aa

Please sign in to comment.