diff options
| author | Loïc Guégan <loic.guegan@mailbox.org> | 2025-09-23 12:14:53 +0200 |
|---|---|---|
| committer | Loïc Guégan <loic.guegan@mailbox.org> | 2025-09-23 12:14:53 +0200 |
| commit | 5b039db15f54f98085fa1b5b22efaa86c49db370 (patch) | |
| tree | 151ff76b89a4d718c332912cfc9c163db2c2a032 /simulations/results/analysis/scheduler/wakeup.awk | |
| parent | a7ae172acb70d3545460fbc468c8d5c7e2cce0ad (diff) | |
Cleaning result folder
Diffstat (limited to 'simulations/results/analysis/scheduler/wakeup.awk')
| -rwxr-xr-x | simulations/results/analysis/scheduler/wakeup.awk | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/simulations/results/analysis/scheduler/wakeup.awk b/simulations/results/analysis/scheduler/wakeup.awk new file mode 100755 index 0000000..1bc8934 --- /dev/null +++ b/simulations/results/analysis/scheduler/wakeup.awk @@ -0,0 +1,43 @@ +#!/usr/bin/awk -f + +BEGIN { + RS="\n" + FS=" " + CSV_HEADER="node,wakets,sleepts,duration" + CSV_DATA="" + skip=1 +} + +/wakes up/{ + gsub("]","",$0) + wakets[$4][length(wakets[$4])+1]=$2 + skip=0 +} + +/is sleeping/{ + gsub("]","",$0) + if(!skip){ + sleepts[$4][length(sleepts[$4])+1]=$2 + } +} + +/LOG2PARSE/{ + gsub("]","",$0) + endts[$6][length(endts[$6])+1]=$2 +} + +END { + print(CSV_HEADER); + for(node in wakets){ + for(j=1;j<=length(wakets[node]);j++){ + start=wakets[node][j] + end=endts[node][1] + # Pay attention, the last sleep report for the last wake up is not printed + # so use the printed sleep only if available (otherwise we use the en of the simulation) + if(j<=length(sleepts[node])){ + end=sleepts[node][j] + } + print(node","start","end","end-start) + } + } +} |
