summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/catlfish_web.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/catlfish_web.erl b/src/catlfish_web.erl
index f3231e4..9869b21 100644
--- a/src/catlfish_web.erl
+++ b/src/catlfish_web.erl
@@ -14,11 +14,13 @@ start(Options, Module) ->
loop(Req, Module) ->
"/" ++ Path = Req:get(path),
try
+ Starttime = os:timestamp(),
case Req:get(method) of
'GET' ->
Query = Req:parse_qs(),
lager:debug("GET ~p ~p", [Path, Query]),
Result = Module:request(get, Path, Query),
+ lager:debug("GET finished: ~p us", [timer:now_diff(os:timestamp(), Starttime)]),
case Result of
none ->
Req:respond({404, [{"Content-Type", "text/plain"}], "Page not found"});
@@ -29,6 +31,7 @@ loop(Req, Module) ->
Body = Req:recv_body(),
lager:debug("POST ~p ~p", [Path, Body]),
Result = Module:request(post, Path, Body),
+ lager:debug("POST finished: ~p us", [timer:now_diff(os:timestamp(), Starttime)]),
case Result of
none ->
Req:respond({404, [{"Content-Type", "text/plain"}], "Page not found"});