|
23 | 23 | -include("yokozuna.hrl").
|
24 | 24 | -include_lib("webmachine/include/webmachine.hrl").
|
25 | 25 |
|
26 |
| --define(YZ_HEAD_FPROF, "yz-fprof"). |
27 |
| - |
28 | 26 | -record(ctx, {security %% security context
|
29 | 27 | }).
|
30 | 28 |
|
@@ -121,8 +119,6 @@ search(Req, S) ->
|
121 | 119 | search(Req, S, Params).
|
122 | 120 |
|
123 | 121 | search(Req, S, Params) ->
|
124 |
| - {FProf, FProfFile} = check_for_fprof(Req), |
125 |
| - ?IF(FProf, fprof:trace(start, FProfFile)), |
126 | 122 | T1 = os:timestamp(),
|
127 | 123 | Index = list_to_binary(wrq:path_info(index, Req)),
|
128 | 124 | try
|
@@ -155,26 +151,13 @@ search(Req, S, Params) ->
|
155 | 151 | ErrReq2 = wrq:set_resp_header("Content-Type", "text/plain",
|
156 | 152 | ErrReq),
|
157 | 153 | {{halt, Code}, ErrReq2, S}
|
158 |
| - after |
159 |
| - ?IF(FProf, fprof_analyse(FProfFile)) |
160 | 154 | end.
|
161 | 155 |
|
162 | 156 | %% @doc Solr returns as chunked but not going to return as chunked from
|
163 | 157 | %% Yokozuna.
|
164 | 158 | scrub_headers(RespHeaders) when is_list(RespHeaders) ->
|
165 | 159 | lists:keydelete("Transfer-Encoding", 1, RespHeaders).
|
166 | 160 |
|
167 |
| -check_for_fprof(Req) -> |
168 |
| - case wrq:get_req_header(?YZ_HEAD_FPROF, Req) of |
169 |
| - undefined -> {false, none}; |
170 |
| - File -> {true, File} |
171 |
| - end. |
172 |
| - |
173 |
| -fprof_analyse(FileName) -> |
174 |
| - fprof:trace(stop), |
175 |
| - fprof:profile(file, FileName), |
176 |
| - fprof:analyse([{dest, FileName ++ ".analysis"}, {cols, 120}]). |
177 |
| - |
178 | 161 | -spec resource_exists(term(), term()) -> {boolean(), term(), term()}.
|
179 | 162 | resource_exists(RD, Context) ->
|
180 | 163 | IndexName = list_to_binary(wrq:path_info(index, RD)),
|
|
0 commit comments