summaryrefslogtreecommitdiff
path: root/.github/workflows/report-backend-memory.yml
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2026-01-22 18:53:53 +0900
committerGitHub <noreply@github.com>2026-01-22 18:53:53 +0900
commita168e7b6486013d05ba836d9a1d084a7708c19fb (patch)
treea9f0a1803e2b32c5c17e0d693777f98c90a8b1b8 /.github/workflows/report-backend-memory.yml
parentUpdate report-backend-memory.yml (diff)
downloadmisskey-a168e7b6486013d05ba836d9a1d084a7708c19fb.tar.gz
misskey-a168e7b6486013d05ba836d9a1d084a7708c19fb.tar.bz2
misskey-a168e7b6486013d05ba836d9a1d084a7708c19fb.zip
enhance(dev): Improve mem report (#17119)
* wip * Update report-backend-memory.yml * Update report-backend-memory.yml * Update measure-memory.mjs * Update report-backend-memory.yml
Diffstat (limited to '.github/workflows/report-backend-memory.yml')
-rw-r--r--.github/workflows/report-backend-memory.yml33
1 files changed, 28 insertions, 5 deletions
diff --git a/.github/workflows/report-backend-memory.yml b/.github/workflows/report-backend-memory.yml
index 30918f44db..bf2e311c83 100644
--- a/.github/workflows/report-backend-memory.yml
+++ b/.github/workflows/report-backend-memory.yml
@@ -85,7 +85,8 @@ jobs:
--argjson VmRSS "$(calc $1 VmRSS)" \
--argjson VmHWM "$(calc $1 VmHWM)" \
--argjson VmSize "$(calc $1 VmSize)" \
- '{VmRSS: $VmRSS, VmHWM: $VmHWM, VmSize: $VmSize}')
+ --argjson VmData "$(calc $1 VmData)" \
+ '{VmRSS: $VmRSS, VmHWM: $VmHWM, VmSize: $VmSize, VmData: $VmData}')
echo "$JSON"
}
@@ -93,7 +94,8 @@ jobs:
JSON=$(jq -c -n \
--argjson beforeGc "$(variation beforeGc)" \
--argjson afterGc "$(variation afterGc)" \
- '{beforeGc: $beforeGc, afterGc: $afterGc}')
+ --argjson afterRequest "$(variation afterRequest)" \
+ '{beforeGc: $beforeGc, afterGc: $afterGc, afterRequest: $afterRequest}')
echo "res=$JSON" >> "$GITHUB_OUTPUT"
- id: build-comment
@@ -108,20 +110,37 @@ jobs:
echo >> ./output.md
table() {
+ echo "| Metric | base (MB) | head (MB) | Diff (MB) | Diff (%) |" >> ./output.md
+ echo "|--------|------:|------:|------:|------:|" >> ./output.md
+
line() {
+ METRIC=$2
BASE=$(echo "$RES" | jq -r ".${1}.${2}.base")
HEAD=$(echo "$RES" | jq -r ".${1}.${2}.head")
DIFF=$(echo "$RES" | jq -r ".${1}.${2}.diff")
DIFF_PERCENT=$(echo "$RES" | jq -r ".${1}.${2}.diff_percent")
- echo "| ${2} | ${BASE} MB | ${HEAD} MB | ${DIFF} MB (${DIFF_PERCENT}%) |" >> ./output.md
+ if (( $(echo "$DIFF_PERCENT > 0" | bc -l) )); then
+ DIFF="+$DIFF"
+ DIFF_PERCENT="+$DIFF_PERCENT"
+ fi
+
+ # highlight VmRSS
+ if [ "$2" = "VmRSS" ]; then
+ METRIC="**${METRIC}**"
+ BASE="**${BASE}**"
+ HEAD="**${HEAD}**"
+ DIFF="**${DIFF}**"
+ DIFF_PERCENT="**${DIFF_PERCENT}**"
+ fi
+
+ echo "| ${METRIC} | ${BASE} MB | ${HEAD} MB | ${DIFF} MB | ${DIFF_PERCENT}% |" >> ./output.md
}
- echo "| Metric | base | head | Diff |" >> ./output.md
- echo "|--------|------|------|------|" >> ./output.md
line $1 VmRSS
line $1 VmHWM
line $1 VmSize
+ line $1 VmData
}
echo "### Before GC" >> ./output.md
@@ -132,6 +151,10 @@ jobs:
table afterGc
echo >> ./output.md
+ echo "### After Request" >> ./output.md
+ table afterRequest
+ echo >> ./output.md
+
# Determine if this is a significant change (more than 5% increase)
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