Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
本番環境でbenchmarkerが動作するように修正したpatch
From 9c7104201bfd484f0cb8e9350ccb94a16504b5d6 Mon Sep 17 00:00:00 2001
From: MATSUU Takuto <matsuu@gmail.com>
Date: Sat, 3 Oct 2020 23:55:09 +0000
Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E7=95=AA=E7=92=B0=E5=A2=83=E3=81=A7be?=
=?UTF-8?q?nchmarker=E3=81=8C=E5=8B=95=E4=BD=9C=E3=81=99=E3=82=8B=E3=82=88?=
=?UTF-8?q?=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3=E3=81=97=E3=81=9Fpatch?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 -
benchmarker/.gitignore | 1 -
benchmarker/Makefile | 7 ++---
benchmarker/checksum/admin.html | 1 +
benchmarker/checksum/audience.html | 1 +
benchmarker/checksum/contestant.html | 1 +
benchmarker/checksum/favicon.ico | 1 +
.../06df2b1eecb1cb2f4f8a3a0f4f9438e2.otf | 1 +
.../120b4c7bbd155bd0a04dc37d334baced.ttf | 1 +
benchmarker/checksum/packs/admin.html | 1 +
benchmarker/checksum/packs/admin.js | 1 +
benchmarker/checksum/packs/admin.js.map | 1 +
benchmarker/checksum/packs/audience.html | 1 +
benchmarker/checksum/packs/audience.js | 1 +
benchmarker/checksum/packs/audience.js.map | 1 +
benchmarker/checksum/packs/contestant.html | 1 +
benchmarker/checksum/packs/contestant.js | 1 +
benchmarker/checksum/packs/contestant.js.map | 1 +
benchmarker/checksum/packs/manifest.json | 1 +
benchmarker/checksum/packs/navbar.js | 1 +
benchmarker/checksum/packs/navbar.js.map | 1 +
benchmarker/checksum/packs/vendor.css | 1 +
benchmarker/checksum/packs/vendor.css.map | 1 +
benchmarker/checksum/packs/vendor.js | 1 +
.../checksum/packs/vendor.js.LICENSE.txt | 1 +
benchmarker/checksum/packs/vendor.js.map | 1 +
benchmarker/checksum/sw.js | 1 +
benchmarker/checksum/sw.js.map | 1 +
benchmarker/go.mod | 1 -
benchmarker/main.go | 30 +------------------
secrets/cert.pem | 1 +
secrets/key.pem | 1 +
32 files changed, 31 insertions(+), 36 deletions(-)
create mode 100644 benchmarker/checksum/admin.html
create mode 100644 benchmarker/checksum/audience.html
create mode 100644 benchmarker/checksum/contestant.html
create mode 100644 benchmarker/checksum/favicon.ico
create mode 100644 benchmarker/checksum/packs/06df2b1eecb1cb2f4f8a3a0f4f9438e2.otf
create mode 100644 benchmarker/checksum/packs/120b4c7bbd155bd0a04dc37d334baced.ttf
create mode 100644 benchmarker/checksum/packs/admin.html
create mode 100644 benchmarker/checksum/packs/admin.js
create mode 100644 benchmarker/checksum/packs/admin.js.map
create mode 100644 benchmarker/checksum/packs/audience.html
create mode 100644 benchmarker/checksum/packs/audience.js
create mode 100644 benchmarker/checksum/packs/audience.js.map
create mode 100644 benchmarker/checksum/packs/contestant.html
create mode 100644 benchmarker/checksum/packs/contestant.js
create mode 100644 benchmarker/checksum/packs/contestant.js.map
create mode 100644 benchmarker/checksum/packs/manifest.json
create mode 100644 benchmarker/checksum/packs/navbar.js
create mode 100644 benchmarker/checksum/packs/navbar.js.map
create mode 100644 benchmarker/checksum/packs/vendor.css
create mode 100644 benchmarker/checksum/packs/vendor.css.map
create mode 100644 benchmarker/checksum/packs/vendor.js
create mode 100644 benchmarker/checksum/packs/vendor.js.LICENSE.txt
create mode 100644 benchmarker/checksum/packs/vendor.js.map
create mode 100644 benchmarker/checksum/sw.js
create mode 100644 benchmarker/checksum/sw.js.map
create mode 120000 secrets/cert.pem
create mode 120000 secrets/key.pem
diff --git a/.gitignore b/.gitignore
index 0f070d3..fb484c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,3 @@ log/
tmp/
vapid_private.pem
*.log
-/secrets/
diff --git a/benchmarker/.gitignore b/benchmarker/.gitignore
index b9f817b..4f85123 100644
--- a/benchmarker/.gitignore
+++ b/benchmarker/.gitignore
@@ -1,4 +1,3 @@
vendor/
proto/**/*.go
-checksum
bin
diff --git a/benchmarker/Makefile b/benchmarker/Makefile
index a93d456..5a6cc3a 100644
--- a/benchmarker/Makefile
+++ b/benchmarker/Makefile
@@ -4,7 +4,6 @@ DIRTY=$(shell git diff --quiet || echo '+dirty')
GOTIMEOUT?=20s
GOARGS?=
GOMAXPROCS?=$(shell nproc)
-GOPRIVATE="github.com/isucon"
GOLDFLAGS=-X main.COMMIT=$(COMMIT)$(DIRTY)
GOFILES=$(wildcard *.go **/*.go)
@@ -27,7 +26,7 @@ test:
@mkdir -p tmp
@echo "mode: atomic" > tmp/cover.out
@for d in $(shell go list ./... | grep -v vendor | grep -v proto); do \
- GOPRIVATE=$(GOPRIVATE) GOMAXPROCS=$(GOMAXPROCS) \
+ GOMAXPROCS=$(GOMAXPROCS) \
go test \
$(GOARGS) \
-timeout $(GOTIMEOUT) \
@@ -45,14 +44,14 @@ clean: ## Cleanup working directory
.PHONY: vendor
vendor: $(GOPROTOFILES)
- GOPRIVATE=$(GOPRIVATE) go mod vendor
+ go mod vendor
.PHONY: help
help: ## Display this help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
$(EXE): Makefile go.mod $(GOFILES) $(GOPROTOFILES) $(PUBLIC_FILES_CHECKSUM)
- GOPRIVATE=$(GOPRIVATE) go build $(GOARGS) -ldflags "$(GOLDFLAGS)" -o $(EXE) -v github.com/isucon/isucon10-final/benchmarker
+ go build $(GOARGS) -ldflags "$(GOLDFLAGS)" -o $(EXE) -v github.com/isucon/isucon10-final/benchmarker
$(GOPROTOFILES): Makefile $(PROTOFILES)
@protoc --go_out=./proto --go-grpc_out=./proto --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative -I ../proto $(PROTOFILES)
diff --git a/benchmarker/checksum/admin.html b/benchmarker/checksum/admin.html
new file mode 100644
index 0000000..8e74b6b
--- /dev/null
+++ b/benchmarker/checksum/admin.html
@@ -0,0 +1 @@
+7b8cef52b761c14f06e307babd0b03dda1b674a66361830cffc9c95b435e510535785cb47540787bd9a631b3528ce0b1
diff --git a/benchmarker/checksum/audience.html b/benchmarker/checksum/audience.html
new file mode 100644
index 0000000..6fc9bac
--- /dev/null
+++ b/benchmarker/checksum/audience.html
@@ -0,0 +1 @@
+e817d98b306a0247f2ea4bc1a48390fde50ceb07c50ffd1b37194a312392a23344e70bd3fa8409d4fcc200bf634e3d91
diff --git a/benchmarker/checksum/contestant.html b/benchmarker/checksum/contestant.html
new file mode 100644
index 0000000..6acbc98
--- /dev/null
+++ b/benchmarker/checksum/contestant.html
@@ -0,0 +1 @@
+90d59995731d4d1c728b594baf6cf832177bc72799b815b9df26a3875655894634c3caa2df5b23af9211c373ecfef214
diff --git a/benchmarker/checksum/favicon.ico b/benchmarker/checksum/favicon.ico
new file mode 100644
index 0000000..a11b4a6
--- /dev/null
+++ b/benchmarker/checksum/favicon.ico
@@ -0,0 +1 @@
+48bfaea2d8f9575dcd26e5cfd8a062ef9e0ee433195a8ebd40bbbc9317f5446aa4fcc6370656f872ccdeec36180d1fe0
diff --git a/benchmarker/checksum/packs/06df2b1eecb1cb2f4f8a3a0f4f9438e2.otf b/benchmarker/checksum/packs/06df2b1eecb1cb2f4f8a3a0f4f9438e2.otf
new file mode 100644
index 0000000..c67c108
--- /dev/null
+++ b/benchmarker/checksum/packs/06df2b1eecb1cb2f4f8a3a0f4f9438e2.otf
@@ -0,0 +1 @@
+0fb82d897ff15d295e28dc65507aeb246ef1b95c18bf6ea463e2bc280468f4b2489b90705fca73c433ab1698a8162da8
diff --git a/benchmarker/checksum/packs/120b4c7bbd155bd0a04dc37d334baced.ttf b/benchmarker/checksum/packs/120b4c7bbd155bd0a04dc37d334baced.ttf
new file mode 100644
index 0000000..e2845f4
--- /dev/null
+++ b/benchmarker/checksum/packs/120b4c7bbd155bd0a04dc37d334baced.ttf
@@ -0,0 +1 @@
+ccd1dd0a0870bf12dcd9edc9c846d78a6b8cbeb2f8eb9a56a16ddade31aac283b82d7a33daacc361d1bcbe5d06ce7e75
diff --git a/benchmarker/checksum/packs/admin.html b/benchmarker/checksum/packs/admin.html
new file mode 100644
index 0000000..8e74b6b
--- /dev/null
+++ b/benchmarker/checksum/packs/admin.html
@@ -0,0 +1 @@
+7b8cef52b761c14f06e307babd0b03dda1b674a66361830cffc9c95b435e510535785cb47540787bd9a631b3528ce0b1
diff --git a/benchmarker/checksum/packs/admin.js b/benchmarker/checksum/packs/admin.js
new file mode 100644
index 0000000..1d83bd7
--- /dev/null
+++ b/benchmarker/checksum/packs/admin.js
@@ -0,0 +1 @@
+af5bcac88b92f9264d60ed1aceb9f957977c1e93c73dbf42f4b42ebe77e2c7698bb80ff5577c803ae83301607297c4fa
diff --git a/benchmarker/checksum/packs/admin.js.map b/benchmarker/checksum/packs/admin.js.map
new file mode 100644
index 0000000..3e378fc
--- /dev/null
+++ b/benchmarker/checksum/packs/admin.js.map
@@ -0,0 +1 @@
+d84ec62e2b9afd0d85b9aabc41c78bb45aec35c076b7e83170968f4909337106a825af36ac2bc18ac154d4d0e5fda512
diff --git a/benchmarker/checksum/packs/audience.html b/benchmarker/checksum/packs/audience.html
new file mode 100644
index 0000000..6fc9bac
--- /dev/null
+++ b/benchmarker/checksum/packs/audience.html
@@ -0,0 +1 @@
+e817d98b306a0247f2ea4bc1a48390fde50ceb07c50ffd1b37194a312392a23344e70bd3fa8409d4fcc200bf634e3d91
diff --git a/benchmarker/checksum/packs/audience.js b/benchmarker/checksum/packs/audience.js
new file mode 100644
index 0000000..63ded73
--- /dev/null
+++ b/benchmarker/checksum/packs/audience.js
@@ -0,0 +1 @@
+b9119aaf09ba46f43aaea63d40c115c1018f7307409d5715980ae557cee1103f5b6a6279d6e537f3203b1bd099c0aa51
diff --git a/benchmarker/checksum/packs/audience.js.map b/benchmarker/checksum/packs/audience.js.map
new file mode 100644
index 0000000..cd5da87
--- /dev/null
+++ b/benchmarker/checksum/packs/audience.js.map
@@ -0,0 +1 @@
+179b3832250061e9a6ae37f68a1c4fb373978df80a9226f694937ec08f01924888f54eaa1b27f3c394a0e5e4852bbe56
diff --git a/benchmarker/checksum/packs/contestant.html b/benchmarker/checksum/packs/contestant.html
new file mode 100644
index 0000000..6acbc98
--- /dev/null
+++ b/benchmarker/checksum/packs/contestant.html
@@ -0,0 +1 @@
+90d59995731d4d1c728b594baf6cf832177bc72799b815b9df26a3875655894634c3caa2df5b23af9211c373ecfef214
diff --git a/benchmarker/checksum/packs/contestant.js b/benchmarker/checksum/packs/contestant.js
new file mode 100644
index 0000000..bd503bd
--- /dev/null
+++ b/benchmarker/checksum/packs/contestant.js
@@ -0,0 +1 @@
+1682eb1e0bf40f6b4996c5af6163b9d7e009be5c2c743986fc0b3abeedd90123396a4520ab883d0cd82f130614f6a1ad
diff --git a/benchmarker/checksum/packs/contestant.js.map b/benchmarker/checksum/packs/contestant.js.map
new file mode 100644
index 0000000..7b7e095
--- /dev/null
+++ b/benchmarker/checksum/packs/contestant.js.map
@@ -0,0 +1 @@
+b444ba6bfe249e7264abc95bf2f8842744534eaaf62d8b0029e78a48357e7c490ca673e2293ef1b97605614385fa1f5d
diff --git a/benchmarker/checksum/packs/manifest.json b/benchmarker/checksum/packs/manifest.json
new file mode 100644
index 0000000..32df9a8
--- /dev/null
+++ b/benchmarker/checksum/packs/manifest.json
@@ -0,0 +1 @@
+f98732e4c775d01d3e7b14186503e5485db45a0cca41bba07e952b67b609d159e5689ae787733d81aa263845db05ed6b
diff --git a/benchmarker/checksum/packs/navbar.js b/benchmarker/checksum/packs/navbar.js
new file mode 100644
index 0000000..c97eef4
--- /dev/null
+++ b/benchmarker/checksum/packs/navbar.js
@@ -0,0 +1 @@
+f8f7a5ded140d826cad8c682b4f82531e48f47fd90c8657f10f22b8b37540d4f676e062b08f8fd5cab79a701e3270e71
diff --git a/benchmarker/checksum/packs/navbar.js.map b/benchmarker/checksum/packs/navbar.js.map
new file mode 100644
index 0000000..a518839
--- /dev/null
+++ b/benchmarker/checksum/packs/navbar.js.map
@@ -0,0 +1 @@
+8811e6cd89d5313ba681b9fcdfa6d63e54bc8482bab041328dc178969d9f4d1f5343962075e866d595209e0d82327a76
diff --git a/benchmarker/checksum/packs/vendor.css b/benchmarker/checksum/packs/vendor.css
new file mode 100644
index 0000000..f9a8bcf
--- /dev/null
+++ b/benchmarker/checksum/packs/vendor.css
@@ -0,0 +1 @@
+f4fa4379deb21b7f66fe5fb9fcc42c6e9b84ccec494535497d60bbfb65ee6d67dcbc94ff87d209eb8c8aef0033d6e29a
diff --git a/benchmarker/checksum/packs/vendor.css.map b/benchmarker/checksum/packs/vendor.css.map
new file mode 100644
index 0000000..8f9763e
--- /dev/null
+++ b/benchmarker/checksum/packs/vendor.css.map
@@ -0,0 +1 @@
+f8aac125df0fd6f4cdabe4f0cfe108c7555cce59370b647a740a46029e28278cd74ab425f4b6af3f8bef884f00abdac3
diff --git a/benchmarker/checksum/packs/vendor.js b/benchmarker/checksum/packs/vendor.js
new file mode 100644
index 0000000..02b69e3
--- /dev/null
+++ b/benchmarker/checksum/packs/vendor.js
@@ -0,0 +1 @@
+9b4453dbbba9b8c1fbd5e887364033e3b64b5f032b44244029f3b5b18cdb27bcf231383f238b89c24afcd03143ed958f
diff --git a/benchmarker/checksum/packs/vendor.js.LICENSE.txt b/benchmarker/checksum/packs/vendor.js.LICENSE.txt
new file mode 100644
index 0000000..0a2c900
--- /dev/null
+++ b/benchmarker/checksum/packs/vendor.js.LICENSE.txt
@@ -0,0 +1 @@
+52e31e62ff626c97feb934b6638fca3d54d418fd6a68931c161f715e2acf310e47abaa55377cbc71ed27c03bf4cfad9d
diff --git a/benchmarker/checksum/packs/vendor.js.map b/benchmarker/checksum/packs/vendor.js.map
new file mode 100644
index 0000000..b39cbea
--- /dev/null
+++ b/benchmarker/checksum/packs/vendor.js.map
@@ -0,0 +1 @@
+7d02e4ac97b9f5deedc3b4d6c6186811d5a8eb7bb59401e3de6bc41252518270c2055bb4f6209c07801efbf907aa08bb
diff --git a/benchmarker/checksum/sw.js b/benchmarker/checksum/sw.js
new file mode 100644
index 0000000..d1bc5de
--- /dev/null
+++ b/benchmarker/checksum/sw.js
@@ -0,0 +1 @@
+6d9c5395f6bd019c885872ff7925c07ca47328676b9c27fc71d9d8b4fce22237d8701d6820f2301e318555e94ae0b673
diff --git a/benchmarker/checksum/sw.js.map b/benchmarker/checksum/sw.js.map
new file mode 100644
index 0000000..c9ca4a3
--- /dev/null
+++ b/benchmarker/checksum/sw.js.map
@@ -0,0 +1 @@
+0c7c37075e714d45ead022ae781325d9437c5682f4e7f5367f75de6860e5b6d7f45f3819f880ea672b687ef5080cc043
diff --git a/benchmarker/go.mod b/benchmarker/go.mod
index 217bde8..841161b 100644
--- a/benchmarker/go.mod
+++ b/benchmarker/go.mod
@@ -8,7 +8,6 @@ require (
github.com/gorilla/mux v1.8.0
github.com/hashicorp/golang-lru v0.5.4
github.com/isucon/isucandar v0.0.0-20200930060615-6a85d46588dd
- github.com/isucon/isucon10-portal v0.0.0-20201001094636-92a7280580d8
github.com/kr/pretty v0.1.0 // indirect
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 // indirect
diff --git a/benchmarker/main.go b/benchmarker/main.go
index 89772f8..8a626ce 100644
--- a/benchmarker/main.go
+++ b/benchmarker/main.go
@@ -23,8 +23,6 @@ import (
"github.com/isucon/isucandar/failure"
"github.com/isucon/isucon10-final/benchmarker/pushserver"
"github.com/isucon/isucon10-final/benchmarker/scenario"
- "github.com/isucon/isucon10-portal/bench-tool.go/benchrun"
- isuxportalResources "github.com/isucon/isucon10-portal/proto.go/isuxportal/resources"
)
// 点数調整用定数
@@ -72,8 +70,6 @@ var (
noClar bool
promOut string
showVersion bool
-
- reporter benchrun.Reporter
)
func init() {
@@ -87,7 +83,7 @@ func init() {
agent.DefaultTLSConfig.MinVersion = tls.VersionTLS12
agent.DefaultTLSConfig.InsecureSkipVerify = false
- flag.StringVar(&targetAddress, "target", benchrun.GetTargetAddress(), "ex: localhost:9292")
+ flag.StringVar(&targetAddress, "target", "localhost", "ex: localhost:9292")
flag.StringVar(&profileFile, "profile", "", "ex: cpu.out")
flag.StringVar(&hostAdvertise, "host-advertise", "local.t.isucon.dev", "hostname to advertise against target")
flag.IntVar(&pushServerPort, "push-service-port", 11001, "port number to listen a push service")
@@ -266,25 +262,6 @@ func sendResult(s *scenario.Scenario, result *isucandar.BenchmarkResult, finish
}
reason = scoreTags
- err := reporter.Report(&isuxportalResources.BenchmarkResult{
- SurveyResponse: &isuxportalResources.SurveyResponse{
- Language: s.Language,
- },
- Finished: finish,
- Passed: passed,
- Score: scoreTotal,
- ScoreBreakdown: &isuxportalResources.BenchmarkResult_ScoreBreakdown{
- Raw: scoreRaw,
- Deduction: scoreDeduction,
- },
- Execution: &isuxportalResources.BenchmarkResult_Execution{
- Reason: reason,
- },
- })
- if err != nil {
- panic(err)
- }
-
return passed
}
@@ -357,11 +334,6 @@ func main() {
panic(err)
}
- reporter, err = benchrun.NewReporter(false)
- if err != nil {
- panic(err)
- }
-
errorCount := int64(0)
b.OnError(func(err error, step *isucandar.BenchmarkStep) {
// Load 中の timeout のみログから除外
diff --git a/secrets/cert.pem b/secrets/cert.pem
new file mode 120000
index 0000000..353f562
--- /dev/null
+++ b/secrets/cert.pem
@@ -0,0 +1 @@
+/etc/ssl/private/tls-cert.pem
\ No newline at end of file
diff --git a/secrets/key.pem b/secrets/key.pem
new file mode 120000
index 0000000..97e64ba
--- /dev/null
+++ b/secrets/key.pem
@@ -0,0 +1 @@
+/etc/ssl/private/tls-key.pem
\ No newline at end of file
--
2.25.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.