2
2
3
3
readonly LOGGING_BRIEF=' brief_logging'
4
4
readonly LOGGING_VERBOSE=' verbose_logging'
5
+ readonly RUN_ID_NONE=' '
5
6
6
7
# Main entrypoint for processing data online using the Build Scan summary tool.
7
8
# All scripts should call this function to fetch Build Scan data used in the
8
9
# experiment summary.
9
10
#
10
- # USAGE: fetch_build_scans_and_build_time_metrics <logging_level> <query>
11
+ # USAGE: fetch_build_scans_and_build_time_metrics <logging_level> <run_id>
12
+ # EXAMPLE: fetch_build_scans_and_build_time_metrics "$LOGGING_BRIEF" "$RUN_ID"
11
13
#
12
- # <logging_level> should be set using either LOGGING_BRIEF or LOGGING_VERBOSE
13
- # constant, e.g., "$LOGGING_BRIEF"
14
- # <query> should be set using either query_none or query_run_id
15
- # function, e.g., "$(query_none)"
14
+ # <logging_level> should be set to the constant LOGGING_BRIEF or LOGGING_VERBOSE
15
+ # <run_id> should be set to the constant RUN_ID or RUN_ID_NONE depending
16
+ # on whether the builds being queried for have a common run id,
17
+ # which will only be the case when both builds were produced
18
+ # during script execution
16
19
process_build_scan_data_online () {
17
20
local logging_level=" $1 "
18
- local query =" $2 "
21
+ local run_id =" $2 "
19
22
20
23
# Always call since it will only read if the metadata file exists
21
24
read_build_scan_metadata
22
25
23
26
local build_scan_data
24
- build_scan_data=" $( fetch_build_scan_data " ${ @ } " ) "
27
+ build_scan_data=" $( fetch_build_scan_data " $logging_level " " $run_id " ) "
25
28
parse_build_scans_and_build_time_metrics " ${build_scan_data} "
26
29
}
27
30
28
- query_none () {
29
- # Intentionally no-op so query definitions can appear consistent
30
- true
31
- }
32
-
33
- query_run_id () {
34
- echo " value:\" Experiment run id=$RUN_ID \" "
35
- }
36
-
37
31
read_build_scan_metadata () {
38
32
# This isn't the most robust way to read a CSV,
39
33
# but we control the CSV so we don't have to worry about various CSV edge cases
@@ -77,7 +71,7 @@ fetch_single_build_scan() {
77
71
local build_scan_url=" $1 "
78
72
79
73
local build_scan_data
80
- build_scan_data=" $( fetch_build_scan_data " $LOGGING_VERBOSE " " $( query_none ) " ) "
74
+ build_scan_data=" $( fetch_build_scan_data " $LOGGING_VERBOSE " " $RUN_ID_NONE " ) "
81
75
82
76
parse_single_build_scan " ${build_scan_data} "
83
77
}
@@ -90,7 +84,7 @@ fetch_single_build_scan() {
90
84
# be done inside this function.
91
85
fetch_build_scan_data () {
92
86
local logging_level=" $1 "
93
- local query =" $2 "
87
+ local run_id =" $2 "
94
88
95
89
if [[ " ${debug_mode} " == " on" ]]; then
96
90
args+=(" --debug" )
@@ -112,8 +106,8 @@ fetch_build_scan_data() {
112
106
args+=(" --build-scan-availability-wait-timeout" " 60" )
113
107
fi
114
108
115
- if [[ -n " ${query } " ]]; then
116
- args+=(" --query " " $query " )
109
+ if [[ -n " ${run_id } " ]]; then
110
+ args+=(" --experiment-run-id " " $run_id " )
117
111
fi
118
112
119
113
for run_num in " ${! build_scan_urls[@]} " ; do
0 commit comments