diff options
author | Anders Svensson <[email protected]> | 2014-04-28 15:04:23 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2014-05-21 10:09:15 +0200 |
commit | d6b3b84abeef4a323a3ddfd89c9a6b131bcd11fc (patch) | |
tree | 0a369636ac9737722d2a2bc0fbb542343a2aff19 /lib/diameter/src/base/diameter_watchdog.erl | |
parent | 25237481ccccd3ddfa74582dc267632ad618ba30 (diff) | |
download | otp-d6b3b84abeef4a323a3ddfd89c9a6b131bcd11fc.tar.gz otp-d6b3b84abeef4a323a3ddfd89c9a6b131bcd11fc.tar.bz2 otp-d6b3b84abeef4a323a3ddfd89c9a6b131bcd11fc.zip |
Count result codes in CEA/DWA/DPA
Corresponding counters for other answer messages have been counted
previously, but those for CEA, DWA, and DPA have been missing since
diameter itself sends these messages and the implementation is as bit
more separate than it might be. The counters are keyed on values of the
following form.
{{ApplicationId, CommandCode, 0 = Rbit}, send|recv, {'Result-Code', RC}}
Diffstat (limited to 'lib/diameter/src/base/diameter_watchdog.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_watchdog.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl index 9a1c8b6585..c17a3bde5d 100644 --- a/lib/diameter/src/base/diameter_watchdog.erl +++ b/lib/diameter/src/base/diameter_watchdog.erl @@ -472,7 +472,6 @@ encode(dwr = M, Dict0, Mask) -> #diameter_packet{bin = Bin} = diameter_codec:encode(Dict0, Pkt), Bin; - encode(dwa, Dict0, #diameter_packet{header = H, transport_data = TD} = ReqPkt) -> AnsPkt = #diameter_packet{header @@ -560,13 +559,21 @@ recv(Name, Pkt, S) -> rcv('DWR', Pkt, #watchdog{transport = TPid, dictionary = Dict0}) -> - send(TPid, {send, encode(dwa, Dict0, Pkt)}), + EPkt = encode(dwa, Dict0, Pkt), + diameter_traffic:incr_A(send, EPkt, TPid, Dict0), + send(TPid, {send, EPkt}), ?LOG(send, 'DWA'); +rcv('DWA', Pkt, #watchdog{transport = TPid, + dictionary = Dict0}) -> + diameter_traffic:incr_A(recv, + diameter_codec:decode(Dict0, Pkt), + TPid, + Dict0); + rcv(N, _, _) when N == 'CER'; N == 'CEA'; - N == 'DWA'; N == 'DPR'; N == 'DPA' -> false; |