Update report-backend-memory.yml
This commit is contained in:
parent
b6e737dc76
commit
1adcb03b93
|
|
@ -98,6 +98,8 @@ jobs:
|
||||||
echo "res=$JSON" >> "$GITHUB_OUTPUT"
|
echo "res=$JSON" >> "$GITHUB_OUTPUT"
|
||||||
- id: build-comment
|
- id: build-comment
|
||||||
name: Build memory comment
|
name: Build memory comment
|
||||||
|
env:
|
||||||
|
RES: ${{ steps.compare.outputs.res }}
|
||||||
run: |
|
run: |
|
||||||
HEADER="## Backend memory usage comparison"
|
HEADER="## Backend memory usage comparison"
|
||||||
FOOTER="[See workflow logs for details](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})"
|
FOOTER="[See workflow logs for details](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID})"
|
||||||
|
|
@ -107,10 +109,10 @@ jobs:
|
||||||
|
|
||||||
table() {
|
table() {
|
||||||
line() {
|
line() {
|
||||||
BASE=$(echo "${{ steps.compare.outputs.res }}" | jq -r ".${1}.${2}.base")
|
BASE=$(echo "$RES" | jq -r ".${1}.${2}.base")
|
||||||
HEAD=$(echo "${{ steps.compare.outputs.res }}" | jq -r ".${1}.${2}.head")
|
HEAD=$(echo "$RES" | jq -r ".${1}.${2}.head")
|
||||||
DIFF=$(echo "${{ steps.compare.outputs.res }}" | jq -r ".${1}.${2}.diff")
|
DIFF=$(echo "$RES" | jq -r ".${1}.${2}.diff")
|
||||||
DIFF_PERCENT=$(echo "${{ steps.compare.outputs.res }}" | jq -r ".${1}.${2}.diff_percent")
|
DIFF_PERCENT=$(echo "$RES" | jq -r ".${1}.${2}.diff_percent")
|
||||||
|
|
||||||
echo "| ${2} | ${BASE} MB | ${HEAD} MB | ${DIFF} MB (${DIFF_PERCENT}%) |" >> ./output.md
|
echo "| ${2} | ${BASE} MB | ${HEAD} MB | ${DIFF} MB (${DIFF_PERCENT}%) |" >> ./output.md
|
||||||
}
|
}
|
||||||
|
|
@ -131,7 +133,7 @@ jobs:
|
||||||
echo >> ./output.md
|
echo >> ./output.md
|
||||||
|
|
||||||
# Determine if this is a significant change (more than 5% increase)
|
# Determine if this is a significant change (more than 5% increase)
|
||||||
if [ "$(echo "${{ steps.compare.outputs.res }}" | jq -r '.afterGc.VmRSS.diff_percent | tonumber > 5')" = "true" ]; then
|
if [ "$(echo "$RES" | jq -r '.afterGc.VmRSS.diff_percent | tonumber > 5')" = "true" ]; then
|
||||||
echo "⚠️ **Warning**: Memory usage has increased by more than 5%. Please verify this is not an unintended change." >> ./output.md
|
echo "⚠️ **Warning**: Memory usage has increased by more than 5%. Please verify this is not an unintended change." >> ./output.md
|
||||||
echo >> ./output.md
|
echo >> ./output.md
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue