summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2018-03-08 11:00:33 -0600
committerPaul J. Davis <paul.joseph.davis@gmail.com>2018-03-08 13:39:19 -0600
commita5cbcf8c1189d84f5838e70624667dbe0161cef5 (patch)
tree7b0aedd9cc17c5679aa3d4559fb17153a9f761d5
parent20d764f5c42f32ef789f4ce6502975a754ee8e66 (diff)
downloadcouchdb-test-looking-glass.tar.gz
WIP: Testing looking_glass for tracingtest-looking-glass
-rw-r--r--rebar.config.script7
-rw-r--r--rel/reltool.config8
-rw-r--r--src/chttpd/src/chttpd.erl12
3 files changed, 24 insertions, 3 deletions
diff --git a/rebar.config.script b/rebar.config.script
index c33a71cb5..ed078f068 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -84,10 +84,15 @@ MakeDep = fun
{AppName, ".*", {git, Url, Version}, Options}
end,
+ExternalDeps = [
+ {lz4, ".*", {git, "https://github.com/rabbitmq/lz4-erlang", "master"}},
+ {looking_glass, ".*", {git, "https://github.com/rabbitmq/looking_glass.git", "master"}}
+],
+
AddConfig = [
{require_otp_vsn, "R16B03|R16B03-1|17|18|19|20"},
{deps_dir, "src"},
- {deps, lists:map(MakeDep, DepDescs)},
+ {deps, lists:map(MakeDep, DepDescs) ++ ExternalDeps},
{sub_dirs, SubDirs},
{lib_dirs, ["src"]},
{erl_opts, [debug_info, {i, "../"}]},
diff --git a/rel/reltool.config b/rel/reltool.config
index 464f5f4fe..bef50ff12 100644
--- a/rel/reltool.config
+++ b/rel/reltool.config
@@ -55,7 +55,9 @@
mochiweb,
rexi,
setup,
- snappy
+ snappy,
+ lz4,
+ looking_glass
]},
{rel, "start_clean", "", [kernel, stdlib]},
{boot_rel, "couchdb"},
@@ -108,7 +110,9 @@
{app, mochiweb, [{incl_cond, include}]},
{app, rexi, [{incl_cond, include}]},
{app, setup, [{incl_cond, include}]},
- {app, snappy, [{incl_cond, include}]}
+ {app, snappy, [{incl_cond, include}]},
+ {app, lz4, [{incl_cond, include}]},
+ {app, looking_glass, [{incl_cond, include}]}
]}.
{overlay_vars, "couchdb.config"}.
diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl
index 6be0d1848..258449a79 100644
--- a/src/chttpd/src/chttpd.erl
+++ b/src/chttpd/src/chttpd.erl
@@ -142,8 +142,20 @@ stop() ->
handle_request(MochiReq0) ->
erlang:put(?REWRITE_COUNT, 0),
MochiReq = couch_httpd_vhost:dispatch_host(MochiReq0),
+ maybe_trace(MochiReq),
handle_request_int(MochiReq).
+
+maybe_trace(MochiReq) ->
+ case MochiReq:get_header_value("x-couchdb-trace") of
+ "true" ->
+ couch_log:info("Trace initializing...", []),
+ lg:trace(['_', {scope, [self()]}], lg_file_tracer, "traces.lz4", #{mode => profile});
+ _ ->
+ ok
+ end.
+
+
handle_request_int(MochiReq) ->
Begin = os:timestamp(),
case config:get("chttpd", "socket_options") of