diff options
author | Anders Svensson <[email protected]> | 2012-08-28 20:28:41 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2012-08-28 22:12:06 +0200 |
commit | d5f20be12d3b7c7ca0313d23275d7a52159c5ffd (patch) | |
tree | 435e029ea25765d00968dcfce87d2ef4a19f9271 /lib/diameter/src | |
parent | 858b3c001b895866d463eff529f9c6cc3b817a58 (diff) | |
download | otp-d5f20be12d3b7c7ca0313d23275d7a52159c5ffd.tar.gz otp-d5f20be12d3b7c7ca0313d23275d7a52159c5ffd.tar.bz2 otp-d5f20be12d3b7c7ca0313d23275d7a52159c5ffd.zip |
Minor counting fix
Diffstat (limited to 'lib/diameter/src')
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index a44ab283ed..18460a113f 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -3084,26 +3084,24 @@ stats_acc(Ref, Dict, Stats) -> %% info_peers/1 %% %% One entry per peer Origin-Host. Statistics for each entry are -%% accumulated values for all associated transport refs and peer pids. +%% accumulated values for all peer pids. info_peers(S) -> - ConnL = conn_list(S), {PeerD, RefD} = lists:foldl(fun peer_acc/2, {dict:new(), dict:new()}, - ConnL), - Refs = lists:append(dict:fold(fun(_, Rs, A) -> [lists:append(Rs) | A] end, + conn_list(S)), + Refs = lists:append(dict:fold(fun(_, Rs, A) -> [Rs|A] end, [], RefD)), Stats = diameter_stats:read(Refs), dict:fold(fun(OH, Cs, A) -> - Rs = lists:append(dict:fetch(OH, RefD)), - [{OH, [{connections, Cs}, stats(Rs, Stats)]} - | A] + Rs = dict:fetch(OH, RefD), + [{OH, [{connections, Cs}, stats(Rs, Stats)]} | A] end, [], PeerD). peer_acc(Peer, {PeerD, RefD}) -> - [Ref, {TPid, _}, [{origin_host, {_, OH}} | _]] - = [proplists:get_value(K, Peer) || K <- [ref, peer, caps]], - {dict:append(OH, Peer, PeerD), dict:append(OH, [Ref, TPid], RefD)}. + [{TPid, _}, [{origin_host, {_, OH}} | _]] + = [proplists:get_value(K, Peer) || K <- [peer, caps]], + {dict:append(OH, Peer, PeerD), dict:append(OH, TPid, RefD)}. |