This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do_format({error, _GL, {Pid, "** gen_event handler" ++ _, Args}}) -> | |
%% gen_event handler terminate | |
[ID, Name, LastMsg, State, Reason] = Args, | |
MsgFmt = "gen_event ~w installed in ~w terminated with reason: ~s~n" ++ | |
case config:get_boolean("couch_log", "strip_sensitive", true) of | |
true -> | |
MsgFmt = "gen_event ~w installed in ~w terminated with reason: ~s~n" ++ | |
" last msg: reducted~n state: ~p", | |
MsgArgs = [ID, Name, format_reason(Reason), State], | |
format(error, Pid, MsgFmt, MsgArgs); |
CouchDB is a distributed system which submits jobs from coordinator nodes to storage nodes. To handle single request, we send it to every node in parallel and then aggregate responses. In order to adequately represent it in traces we need support for nested spans. This quick experiment tests how this case is rendered in Jaeger.
Run jaeger as follows
./jaeger-all-in-one --collector.zipkin.http-port=9411
Execute test script
python3 trace.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/apache/couchdb-mochiweb | |
cd couchdb-mochiweb | |
git diff bd6eb60..CouchDB-2.12.0-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% https://github.com/cloudant/couchdb/pull/7-module(couch_ejson_size). | |
-export([ejson_size/1]). | |
-ifdef(TEST). | |
-compile(export_all). | |
-include_lib("proper/include/proper.hrl"). | |
-endif. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skip_n_terms(Bin, N) -> | |
lists:foldl(fun(_, {Acc, Bin}) -> | |
{Skipped, R} = skip_term(Bin), | |
{Skipped + Acc, R} | |
end, {0, Bin}, lists:seq(1, N)). | |
skip_term(<<97, _:1/binary, Rest/binary>>) -> %% SMALL_INTEGER_EXT | |
{2, Rest}; | |
skip_term(<<98, _:4/binary, Rest/binary>>) -> %% INTEGER_EXT | |
{5, Rest}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
function pr_label { | |
REPO_URL=${1} | |
PR=${2} | |
REPO=${REPO_URL##https://github.com/} | |
echo `curl -s https://api.github.com/repos/${REPO}/pulls/${PR} \ | |
| jq .head.label | tr -d '"'` | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/rebar.config.script | |
+++ b/rebar.config.script | |
@@ -21,6 +23,12 @@ os:putenv("COUCHDB_CONFIG", ConfigureEnv). | |
os:putenv("COUCHDB_APPS_CONFIG_DIR", filename:join([COUCHDB_ROOT, "rel/apps"])). | |
+Features = lists:filter(fun({_K, Flag}) -> Flag end, [ | |
+ {'HAS_ERL_SCAN_TOKEN_INFO', erlang:function_exported(erl_scan, token_info, 1)} | |
+]), | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SUFFIX=`date "+test-%s"` | |
export PORT=15984 | |
export HOST=localhost | |
export DB=test-${SUFFIX} | |
export USER=foo-${SUFFIX} | |
echo -e "\033[32mCreate user" | |
cat <<EOF | http -v --auth='adm:pass' PUT http://${HOST}:${PORT}/_users/org.couchdb.user:${USER} | |
{ | |
"_id": "org.couchdb.user:${USER}", |
NewerOlder