たとえば、つぎのようにパイプ演算子|>で続く処理の間にIO.inspect/2を挟んで、値がどのように変わるのか確かめられます。これにより結果が変わることはありません。 defmodule Example do def square_sum(first, last) do for i <- first..last do i end |> IO.inspect |> Enum.map(fn x -> x * x end) |> IO.inspect |> Enum.sum end end
たとえば、つぎのようにパイプ演算子|>で続く処理の間にIO.inspect/2を挟んで、値がどのように変わるのか確かめられます。これにより結果が変わることはありません。 defmodule Example do def square_sum(first, last) do for i <- first..last do i end |> IO.inspect |> Enum.map(fn x -> x * x end) |> IO.inspect |> Enum.sum end end
This article is for beginners especially who have been started playing with GenServer . Today, you are going to build an OTP server and you will trace the server using simple technique. This is not a technique, it is an option while calling the start_link/3 function. Talk is cheap, lets code it. What we do here ?We together implement the STACK server and will trace that server. As you know stack i
redbugはErlangコードのトレースに使用するデバッグ用ツールです。 eper というパフォーマンス関連ツールの一部として配布されています。 これを使うと、指定した関数のトレースがとても手軽に行えます。 redbugで出来る事 モジュール名、関数名、引数でのトレース対象指定(ワイルドカード可) 引数の確認 戻り値の確認 コールスタックの確認 Riakでの実行例 (riak1@127.0.0.1)81> redbug:start({riak_kv_vnode, put,[return, stack]},[{time,5000},{msgs,4},{max_msg_size,10000 000},{print_depth,10}]). ok 20:17:34 <{riak_kv_put_fsm,init,1}> {riak_kv_vnode,put, [[{685078892498860
erlang でエラーログを管理する方法を調べたのでメモ。 まず、sasl の設定ファイルを作成。適当に elog.config として保存する。 [{sasl, [ {sasl_error_logger, false}, {errlog_type, error}, {error_logger_mf_dir, "/path/to/logs"}, {error_logger_mf_maxbytes, 10485760}, %% 10MB {error_logger_mf_maxfiles, 10} ]}]. Programming Erlang まんまですが・・・これで、error のみ /path/to/logs 配下のファイルに保存し、ファイルのローテーションも行ってくれる。(上記設定で、1 ファイル最大 10MB で 10 ファイルまで保持する) 次に、下記のように erl を実行する
The basic steps of tracing for function calls are on a non-live node: > dbg:start(). % start dbg > dbg:tracer(). % start a simple tracer process > dbg:tp(Module, Function, Arity, []). % specify MFA you are interested in > dbg:p(all, c). % trace calls (c) of that MFA for all processes. ... trace here > dbg:stop_clear(). % stop tracer and clear effect of tp and p calls. You can trace for multiple fu
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く