mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 18:53:43 -04:00
Add benchmark result to GitHub PR (#2123)
* Add benchmark result to GitHub PR Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Post benchmark to comments Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Test Stuff Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update using jq. Signed-off-by: Yong Tang <yong.tang.github@outlook.com> * Update Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
13
.benchmark.sh
Normal file
13
.benchmark.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e +o pipefail
|
||||
|
||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then
|
||||
echo -e "NOTE: The CPU benchmarks are performed on Travis VMs and vary widly between runs," > .benchmark.body
|
||||
echo -e " you can't trust them. The memory benchmarks are OK\n\n" >> .benchmark.body
|
||||
cat .benchmark.log >> .benchmark.body
|
||||
jq -n --arg body "$(cat .benchmark.body)" '{body: $body}' > .benchmark.json
|
||||
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST \
|
||||
--data-binary "@.benchmark.json" \
|
||||
"https://api.github.com/repos/${TRAVIS_REPO_SLUG}/issues/${TRAVIS_PULL_REQUEST}/comments"
|
||||
fi
|
||||
Reference in New Issue
Block a user