Commit 0ac16d86 authored by Heinz N. Gies's avatar Heinz N. Gies

Add debug option

parent ecf316d7
{application, dalmatiner_frontend,
[
{description, "Frontend server for dalmatiner DB"},
{vsn, "0.3.0"},
{vsn, "0.3.1"},
{registered, []},
{applications, [
kernel,
......
......@@ -21,13 +21,22 @@ handle(Req, State) ->
{ok, Req3} = cowboy_req:reply(200, Req2),
{ok, Req3, State};
{Q, Req1} ->
case timer:tc(dqe, run, [Q]) of
{Opts, Req2} = case cowboy_req:qs_val(<<"debug">>, Req1) of
{undefined, ReqX} ->
{[{timeout, infinity}], ReqX};
{<<>>, ReqX} ->
{[{timeout, infinity}, debug], ReqX};
{Token, ReqX} ->
{[{timeout, infinity}, debug,
{token, Token}], ReqX}
end,
case timer:tc(dqe, run, [Q, Opts]) of
{_, {error, E}} ->
Error = list_to_binary(dqe:error_string({error, E})),
lager:warning("Error in query [~s]: ~p", [Q, E]),
{ok, Req2} =
cowboy_req:reply(400, [], Error, Req1),
{ok, Req2, State};
{ok, Req3} =
cowboy_req:reply(400, [], Error, Req2),
{ok, Req3, State};
{T, {ok, Start, R2}} ->
R3 = [#{name => Name,
resolution => Resolution,
......@@ -51,8 +60,8 @@ handle(Req, State) ->
D = #{start => Start,
query_time => T,
results => R3 ++ R4},
{ContentType, Req2} = content_type(Req1),
send(ContentType, D, Req2, State)
{ContentType, Req3} = content_type(Req2),
send(ContentType, D, Req3, State)
end
end.
......
......@@ -8,6 +8,7 @@
{deps,
[
{erlware_commons, "~>1.0.0"},
{lager, "~>3.2.0"},
{ranch, "~>1.2.0"},
{cowboy, "~>1.0.0"},
......@@ -23,7 +24,7 @@
%% Plugins
%%-------------------------------------------------------------------
{project_plugins, [{rebar3_cuttlefish, "0.10.0"}]}.
{project_plugins, [{rebar3_cuttlefish, "~>0.14.0"}]}.
%%-------------------------------------------------------------------
%% Cuttlefish
......@@ -84,7 +85,7 @@
%%-------------------------------------------------------------------
{relx,
[{release, {dalmatinerfe, "0.3.0"},
[{release, {dalmatinerfe, "0.3.1"},
[sasl,
dalmatiner_frontend,
{runtime_tools, load}, %% for dyntrace
......@@ -98,7 +99,8 @@
{generate_start_script, false},
{overlay_vars, "rel/vars.config"},
{overlay,
[{mkdir, "etc"},
[
{mkdir, "etc"},
{mkdir, "share"},
{copy, "rel/files/erl", "erts-\{\{erts_vsn\}\}/bin/erl"},
{copy, "rel/files/nodetool", "erts-\{\{erts_vsn\}\}/bin/nodetool"},
......
{"1.1.0",
[{<<"cf">>,{pkg,<<"cf">>,<<"0.2.1">>},3},
[{<<"cf">>,{pkg,<<"cf">>,<<"0.2.2">>},1},
{<<"cowboy">>,{pkg,<<"cowboy">>,<<"1.0.4">>},0},
{<<"cowlib">>,{pkg,<<"cowlib">>,<<"1.0.2">>},1},
{<<"ddb_client">>,{pkg,<<"ddb_client">>,<<"0.2.0">>},2},
{<<"ddb_connection">>,{pkg,<<"ddb_connection">>,<<"0.1.20">>},1},
{<<"dflow">>,{pkg,<<"dflow">>,<<"0.1.5">>},1},
{<<"dflow">>,{pkg,<<"dflow">>,<<"0.1.7">>},1},
{<<"dproto">>,{pkg,<<"dproto">>,<<"0.2.2">>},1},
{<<"dqe">>,
{git,"https://github.com/dalmatinerdb/dqe.git",
{ref,"c14c6aff0d744fbf001f109da4d0dc8d6e38321f"}},
{ref,"b29247d5c21718ad0b50f4aa8262aace4724060b"}},
0},
{<<"dqe_fun">>,{pkg,<<"dqe_fun">>,<<"0.1.11">>},1},
{<<"dqe_idx">>,{pkg,<<"dqe_idx">>,<<"0.2.1">>},1},
......@@ -17,7 +17,7 @@
{<<"eper">>,{pkg,<<"eper">>,<<"0.94.0">>},0},
{<<"epgsql">>,{pkg,<<"epgsql">>,<<"3.3.0">>},3},
{<<"erlang_localtime">>,{pkg,<<"erlang_localtime">>,<<"1.0.0">>},2},
{<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"0.20.0">>},2},
{<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"1.0.0">>},0},
{<<"fifo_utils">>,{pkg,<<"fifo_utils">>,<<"0.1.30">>},0},
{<<"goldrush">>,{pkg,<<"goldrush">>,<<"0.1.9">>},1},
{<<"hdr_histogram">>,{pkg,<<"hdr_histogram">>,<<"0.2.0">>},1},
......@@ -36,12 +36,12 @@
{<<"uuid">>,{pkg,<<"uuid_erl">>,<<"1.5.4">>},1}]}.
[
{pkg_hash,[
{<<"cf">>, <<"69D0B1349FD4D7D4DC55B7F407D29D7A840BF9A1EF5AF529F1EBE0CE153FC2AB">>},
{<<"cf">>, <<"7F2913FFF90ABCABD0F489896CFEB0B0674F6C8DF6C10B17A83175448029896C">>},
{<<"cowboy">>, <<"A324A8DF9F2316C833A470D918AAF73AE894278B8AA6226CE7A9BF699388F878">>},
{<<"cowlib">>, <<"9D769A1D062C9C3AC753096F868CA121E2730B9A377DE23DEC0F7E08B1DF84EE">>},
{<<"ddb_client">>, <<"CAFEFB981C6697303285C23EA6C160EB9CD37D516AD4BF2D33126E2BDB0DC571">>},
{<<"ddb_connection">>, <<"600C18E0910CE0A6744941A74AEEB569D5BABF15D5282A442C24B5635DA71CAD">>},
{<<"dflow">>, <<"EF3960BB86732807A87B75035144BB4F2392803D53F02091A71AB4A777AC5F6C">>},
{<<"dflow">>, <<"7B4B17789C99C7D9FECB4CFFA37841DB4C025F7823B1E7DDCE88A248DF53F27B">>},
{<<"dproto">>, <<"DD979C4BD18CF9672B8ABB85FF657D0BE53D4787321E7EB9C123D0CB7EC060F0">>},
{<<"dqe_fun">>, <<"C421415293F8C2DD29E7F31788E4FB06B57D0A5E38D527BF6C78E3C72CBC0BDA">>},
{<<"dqe_idx">>, <<"6BD1F0DE217DF0B213BD86CDBE19F5EEDBCAF0D5CBD51D955DB574A5C2DBA1EE">>},
......@@ -50,7 +50,7 @@
{<<"eper">>, <<"F5FB2DAA0DF8878748E1C598428EDA942A173E5121FF35C1D632129B84593A3A">>},
{<<"epgsql">>, <<"974A578340E52012CBAB820CE756E7ED1DF1BAF0110C59A6753D8337A2CF9454">>},
{<<"erlang_localtime">>, <<"497DFD4D13523D3E0EECDCB8D6D59857CF642A17A6BDC6133FF906FDAF2AEF21">>},
{<<"erlware_commons">>, <<"721F902031D0313E192FD4038C326F89415855CD1A5CF804AB04B314D0944146">>},
{<<"erlware_commons">>, <<"087467DE5833C0BB5B3CCDD387F9E9C1FB816A75B7A709629BF24B5ED3246C51">>},
{<<"fifo_utils">>, <<"388002C613C627564325ACF739756887DDFC857CB31E1E2451FAD157384903D1">>},
{<<"goldrush">>, <<"F06E5D5F1277DA5C413E84D5A2924174182FB108DABB39D5EC548B27424CD106">>},
{<<"hdr_histogram">>, <<"95A7EC3C8FA354E4CFBFC8F4168EE8F07BD3965CA22B9C45B2A2C9D13B03DCEC">>},
......
VERSION=0.3.0
VERSION=0.3.1
COMPONENT_INTERNAL=dalmatinerfe
COMPONENT=dalmatinerfe
DEPS="erlang" "coreutils" "sudo"
......
......@@ -30,4 +30,4 @@
{platform_log_dir, "/data/dalmatinerfe/log"}.
{bugsnag_app_version, "0.3.0"}.
{bugsnag_app_version, "0.3.1"}.
├─ cowboy─1.0.4
│ └─ cowlib─1.0.2
├─ dalmatiner_frontend─0.3.0
├─ dqe─0.4.14
├─ dqe─0.4.15
│ ├─ ddb_connection─0.1.20
│ │ ├─ ddb_client─0.2.0
│ │ └─ poolboy─1.5.1
│ ├─ dflow─0.1.5
│ ├─ dflow─0.1.7
│ ├─ dproto─0.2.2
│ │ ├─ jsxd─0.2.3
│ │ └─ snappy─1.1.1
......@@ -18,10 +18,10 @@
│ ├─ hdr_histogram─0.2.0
│ ├─ mmath─0.2.14
│ └─ qdate─0.4.3
│ ├─ erlang_localtime─1.0.0
│ └─ erlware_commons─0.20.0
│ └─ cf─0.2.1
│ └─ erlang_localtime─1.0.0
├─ eper─0.94.0
├─ erlware_commons─1.0.0
│ └─ cf─0.2.2
├─ fifo_utils─0.1.30
│ └─ uuid─1.5.4
│ └─ quickrand─1.5.4
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment