isucon勉強記録 ふつかめ

いきなり気分が沈んでやる気が微妙になったんだけどまあほんのちょっとでもいいから毎日何かしらやるということにしたい。アイドルマスターのライブで切れそうだけど。

k0kubun.hatenablog.com

を導入してみた。けどこのままだと/loginとかのapiがプロファイリングできない(DBにはハッシュしかないので)。

というわけで簡易にエンドポイントとパラメータを取得して出力するRack middleware的な何かしらが必要な気がする。それか、すべてのアクセスに対してこのgemのprofiling parameterを追加すればいいのか。

つづきはあした。

追記:エントリにあるprofileオプション使えばいいだけの話だった。読解力ない…… ただUnicornのログとごっちゃになるからそこを工夫しないとちょっとめんどくさい。

追追記 fail増えた。

08:17:26 type:fail      reason:Get http://localhost:8080/images/isucon-bank.png: EOF    method:GET      uri:/images/isucon-bank.png
08:17:27 type:fail      reason:Post http://localhost:8080/: EOF method:POST     uri:/login
08:17:27 type:fail      reason:Post http://localhost:8080/login: EOF    method:POST     uri:/login
08:17:28 type:fail      reason:Post http://localhost:8080/: EOF method:POST     uri:/login
08:17:39 type:fail      reason:Connection timeout       method:POST     uri:/login
08:17:39 type:fail      reason:Post http://localhost:8080/login: EOF    method:POST     uri:/login
08:17:40 type:fail      reason:Post http://localhost:8080/login: EOF    method:POST     uri:/login
08:17:40 type:fail      reason:Post http://localhost:8080/login: EOF    method:POST     uri:/login
08:17:41 type:fail      reason:Get http://localhost:8080/stylesheets/isucon-bank.css: EOF       method:GET      uri:/stylesheets/isucon-bank.css
08:17:41 type:fail      reason:Post http://localhost:8080/login: EOF    method:POST     uri:/login
08:17:41 type:fail      reason:Post http://localhost:8080/login: EOF    method:POST     uri:/login
08:17:42 type:fail      reason:Post http://localhost:8080/login: EOF    method:POST     uri:/login
08:17:43 type:fail      reason:Response code should be 200, got 500     method:POST     uri:/login
08:17:43 type:fail      reason:Post http://localhost:8080/login: EOF    method:POST     uri:/login
08:17:53 type:fail      reason:Connection timeout       method:POST     uri:/login
08:17:54 type:fail      reason:Post http://localhost:8080/login: EOF    method:POST     uri:/login
08:18:04 type:fail      reason:Connection timeout       method:GET      uri:/stylesheets/isucon-bank.css
08:18:04 type:fail      reason:Connection timeout       method:GET      uri:/stylesheets/bootstrap.min.css
08:18:14 type:fail      reason:Connection timeout       method:GET      uri:/
08:18:24 type:fail      reason:Connection timeout       method:GET      uri:/
08:18:34 type:fail      reason:Request cancelled because benchmark finished (1min)      method:GET      uri:/
08:18:34 type:info      message:finish benchmark workload: 1
08:18:39 type:info      message:check banned ips and locked users report
08:19:05 type:report    count:banned ips        value:0
08:19:05 type:report    count:locked users      value:2500
08:19:05 type:info      message:Result not sent to server because API key is not set
08:19:05 type:score     success:156     fail:21 score:35

静的ファイルへのアクセスとPOSTメソッドについては余計なもんつけるとダメっぽいのかな。まだアプリケーションコードすらもちゃんと読めてないからわかんない(時間取れてないのよくない……)