Heinz N. Gies 12 年 前
コミット
65341b4b59

+ 1 - 1
cowboy/src/db_handler.erl

@@ -22,7 +22,7 @@ handle(Req, State) ->
 			        {result_packet, _, _, [Res], _} <- [emysql:execute(test_pool, db_stmt, [random:uniform(10000)]) || _ <- lists:seq(1, I) ]],
 			{Res, Req1}
 		end,
-	{ok, Req3} = cowboy_req:reply(200, [{<<"Content-Type">>, <<"application/json">>}], jiffy:encode(JSON), Req2),
+	{ok, Req3} = cowboy_req:reply(200, [{<<"Content-Type">>, <<"application/json">>}], jsx:encode(JSON), Req2),
 	{ok, Req3, State}.
 
 terminate(_Reason, _Req, _State) ->

+ 1 - 1
cowboy/src/hello_world_app.erl

@@ -14,7 +14,7 @@ start(_Type, _Args) ->
         crypto:start(),
         application:start(emysql),
         application:start(jiffy),
-        emysql:add_pool(test_pool, 5,
+        emysql:add_pool(test_pool, 32,
           "benchmarkdbuser", "benchmarkdbpass", "localhost", 3306,
           "hello_world", utf8),
 	emysql:prepare(db_stmt, <<"SELECT * FROM World where id = ?">>),

+ 1 - 1
cowboy/src/json_handler.erl

@@ -11,7 +11,7 @@ init(_Transport, Req, []) ->
 	{ok, Req, undefined}.
 
 handle(Req, State) ->
-	{ok, Req2} = cowboy_req:reply(200, [{<<"Content-Type">>, <<"application/json">>}], jiffy:encode({[{<<"message">>, <<"Hello, World!">>}]}), Req),
+	{ok, Req2} = cowboy_req:reply(200, [{<<"Content-Type">>, <<"application/json">>}], jsx:encode([{<<"message">>, <<"Hello, World!">>}]), Req),
 	{ok, Req2, State}.
 
 terminate(_Reason, _Req, _State) ->