|
84 | 84 | name: performance-results |
85 | 85 | path: results |
86 | 86 |
|
87 | | - - name: List files |
88 | | - shell: bash |
89 | | - run: | |
90 | | - ls -l results |
91 | | -
|
92 | 87 | - name: Save results into memory |
93 | 88 | shell: bash |
94 | 89 | run: | |
@@ -126,69 +121,49 @@ jobs: |
126 | 121 | shell: bash |
127 | 122 | run: | |
128 | 123 | set -euxo pipefail |
129 | | - python3 - <<'PY' |
130 | | - import csv |
131 | | - from pathlib import Path |
132 | | - import matplotlib.pyplot as plt |
133 | | -
|
134 | | - ts_csv = Path("ci/metrics/complete_profile/complete_profile_timeseries.csv") |
135 | | - out_png = Path("build/complete_profile_last30.png") |
136 | | - out_png.parent.mkdir(parents=True, exist_ok=True) |
137 | | -
|
138 | | - if not ts_csv.exists(): |
139 | | - raise SystemExit("time-series CSV not found") |
140 | | -
|
141 | | - rows = [] |
142 | | - with ts_csv.open(newline="") as fh: |
143 | | - reader = csv.DictReader(fh) |
144 | | - header = reader.fieldnames or [] |
145 | | - for r in reader: |
146 | | - rows.append(r) |
147 | | -
|
148 | | - if not rows: |
149 | | - raise SystemExit("No rows in time-series CSV") |
150 | | -
|
151 | | - rows = rows[-30:] # last 30 runs |
152 | | -
|
153 | | - # Choose numeric columns (skip date, run, sha) |
154 | | - skip = {"date","run","sha"} |
155 | | - cols = [h for h in header if h not in skip] |
156 | | -
|
157 | | - x = range(1, len(rows)+1) |
158 | | - dates = [r["date"] for r in rows] |
159 | | -
|
160 | | - plt.figure() |
161 | | - for key in cols: |
162 | | - try: |
163 | | - ys = [int(r.get(key,0)) for r in rows] |
164 | | - except Exception: |
165 | | - continue |
166 | | - plt.plot(x, ys, label=key) |
167 | | -
|
168 | | - plt.title("Complete Profile") |
169 | | - plt.xlabel("Date") |
170 | | - plt.ylabel("Bytes") |
171 | | - step = max(1, len(dates)//8) |
172 | | - shown = list(range(0, len(dates), step)) |
173 | | - plt.xticks([i+1 for i in shown], [dates[i] for i in shown], rotation=45, ha="right") |
174 | | -
|
175 | | - plt.legend() |
176 | | - plt.tight_layout() |
177 | | - plt.savefig(out_png) |
178 | | - print(f"Wrote {out_png}") |
179 | | - PY |
| 124 | +
|
| 125 | + LAST_N=52 |
| 126 | + |
| 127 | + python3 ci/metrics/generate_plot.py \ |
| 128 | + --input ci/metrics/memory/complete_profile_timeseries.csv \ |
| 129 | + --output plots/complete_profile_plot.png \ |
| 130 | + --title "Complete Profile" \ |
| 131 | + --ylabel "Bytes" \ |
| 132 | + --last LAST_N |
| 133 | + python3 ci/metrics/generate_plot.py \ |
| 134 | + --input ci/metrics/memory/core_profile_timeseries.csv \ |
| 135 | + --output plots/core_profile_plot.png \ |
| 136 | + --title "Core Profile" \ |
| 137 | + --ylabel "Bytes" \ |
| 138 | + --last LAST_N |
| 139 | + python3 ci/metrics/generate_plot.py \ |
| 140 | + --input ci/metrics/memory/stack_timeseries.csv \ |
| 141 | + --output plots/stack_plot.png \ |
| 142 | + --title "Simple App Stack Usage" \ |
| 143 | + --ylabel "Bytes" \ |
| 144 | + --last LAST_N |
| 145 | + python3 ci/metrics/generate_plot.py \ |
| 146 | + --input ci/metrics/memory/profiles_bss_timeseries.csv \ |
| 147 | + --output plots/profiles_bss_plot.png \ |
| 148 | + --title "Increase of .bss memory by enabling profiles" \ |
| 149 | + --ylabel "Bytes" \ |
| 150 | + --last LAST_N |
| 151 | + python3 ci/metrics/generate_plot.py \ |
| 152 | + --input ci/metrics/memory/profiles_data_timeseries.csv \ |
| 153 | + --output plots/profiles_data_plot.png \ |
| 154 | + --title "Increase of .data memory by enabling profiles" \ |
| 155 | + --ylabel "Bytes" \ |
| 156 | + --last LAST_N |
| 157 | + python3 ci/metrics/generate_plot.py \ |
| 158 | + --input ci/metrics/memory/profiles_text_timeseries.csv \ |
| 159 | + --output plots/profiles_text_plot.png \ |
| 160 | + --title "Increase of .text memory by enabling profiles" \ |
| 161 | + --ylabel "Bytes" \ |
| 162 | + --last LAST_N |
180 | 163 |
|
181 | 164 | - name: Upload plots |
182 | 165 | uses: actions/upload-artifact@v4 |
183 | 166 | with: |
184 | 167 | name: performance-plots |
185 | | - path: build/*.png |
| 168 | + path: plots/*.png |
186 | 169 | if-no-files-found: warn |
187 | | - |
188 | | - - name: Add summary |
189 | | - if: always() |
190 | | - shell: bash |
191 | | - run: | |
192 | | - echo "## Complete Profile (last 30 runs)" >> "$GITHUB_STEP_SUMMARY" |
193 | | - echo "" >> "$GITHUB_STEP_SUMMARY" |
194 | | - echo "" >> "$GITHUB_STEP_SUMMARY" |
0 commit comments