Skip to content

Commit

Permalink
stats: bring in big-merge (#143)
Browse files Browse the repository at this point in the history
This add the big-merge builds to the llvm+clang+compiler-rt+libomp stats. You can distinguish the data because the chroots for the big-merge builds are prefixed with `big-merge-`.
  • Loading branch information
kwk authored Dec 22, 2023
1 parent 3eea39c commit 538a15f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 13 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/update-build-time-diagrams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:
with:
ref: 'main'
path: 'main'

- name: Checkout gh-pages branch
uses: actions/checkout@v3
with:
ref: 'gh-pages'
path: 'gh-pages'

- name: "Check for cached dependencies"
uses: actions/cache@v3
with:
Expand All @@ -71,20 +71,21 @@ jobs:
shell: bash -e {0}
env:
get_stats: ${{ github.event_name == 'schedule' && true || github.event.inputs.get_stats }}
create_diagrams: ${{ github.event_name == 'schedule' && true || github.event.inputs.create_diagrams }}
create_diagrams: ${{ github.event_name == 'schedule' && true || github.event.inputs.create_diagrams }}
run: |
if ${{ env.get_stats }}; then
main/build-stats/get-build-stats.py | tee -a gh-pages/build-stats.csv
git -C gh-pages add build-stats.csv
main/build-stats/get-build-stats.py --copr-projectname llvm-snapshots-incubator-$d | tee -a gh-pages/build-stats.csv
main/build-stats/get-build-stats.py --copr-projectname llvm-snapshots-big-merge-$d | tee -a gh-pages/build-stats-big-merge.csv
git -C gh-pages add build-stats.csv build-stats-big-merge.csv
fi
if ${{ env.create_diagrams }}; then
main/build-stats/create-diagrams.py --datafile gh-pages/build-stats.csv
main/build-stats/create-diagrams.py --datafile gh-pages/build-stats.csv --datafile-big-merge gh-pages/build-stats-big-merge.csv
mv index.html gh-pages/index.html
mv fig-*.html gh-pages/
git -C gh-pages add index.html fig-*.html
fi
if [[ ${{ env.get_stats }} || ${{ env.create_diagrams }} ]]; then
cd gh-pages
git commit -m "Automatically update stats build stats"
git commit -m "Automatically update build stats"
git push origin HEAD:gh-pages
fi
fi
37 changes: 32 additions & 5 deletions build-stats/create-diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def add_html_header_menu(
for package_name in all_packages
]
)
header_menu += ' | <a href="fig-combined-standalone.html">llvm+clang+compiler-rt+libomp (standalone)</a>'
header_menu += (
' | <a href="fig-combined-standalone.html">llvm+clang+compiler-rt+libomp</a>'
)
header_menu += "</div>"
header_menu += replace_me

Expand Down Expand Up @@ -248,7 +250,10 @@ def create_index_page(all_packages: [str], filepath: str = "index.html") -> None
</head>
<body>
<h1>{title}</h1>
<ul>{package_link_items}</ul>
<ul>
{package_link_items}
<li><a href="fig-combined-standalone.html">llvm+clang+compiler-rt+libomp</a></li>
</ul>
<hr/>
<small>Last updated: {last_updated}</small>
</body>
Expand Down Expand Up @@ -283,6 +288,13 @@ def main() -> None:
default="build-stats.csv",
help="path to your build-stats.csv file",
)
parser.add_argument(
"--datafile-big-merge",
dest="datafile_big_merge",
type=str,
default="build-stats-big-merge.csv",
help="path to your build-stats-big-merge.csv file",
)
args = parser.parse_args()

# %%
Expand All @@ -309,11 +321,26 @@ def main() -> None:
save_figure(fig=fig, filepath=filepath)
add_html_header_menu(filepath=filepath, all_packages=all_packages)

# Create combined plot of llvm, clang, compiler-rt and openmp (aka libomp)
# Create dataframe of llvm, clang, compiler-rt and libomp combined in
# standalone-mode
df_combined = prepare_data_combined(
filepath=args.datafile, package_names=["llvm", "clang", "compiler-rt", "libomp"]
filepath=args.datafile,
package_names=["llvm", "clang", "compiler-rt", "libomp"],
)
fig = create_figure(df=df_combined)

# Create dataframe of llvm, clang, compiler-rt and libomp but when build in
# big-merge mode. The chroots are suffixed with "-big-merge" on the fly to
# be able to distinguish the two cases.
df_big_merge = prepare_data(filepath=args.datafile_big_merge)
df_big_merge["chroot"] = "big-merge-" + df_big_merge["chroot"]
# Convert build_id column with int64's in it to an array of int64's to match
# that of the combined standalone dataframe above (see: df_combined).
df_big_merge.build_id = df_big_merge.build_id.apply(lambda x: [x])

# Concat the two dataframes of combined standalone and big-merge
df_result = pd.concat([df_combined, df_big_merge])

fig = create_figure(df=df_result)
filepath = "fig-combined-standalone.html"
save_figure(fig=fig, filepath=filepath)
add_html_header_menu(filepath=filepath, all_packages=all_packages)
Expand Down

0 comments on commit 538a15f

Please sign in to comment.