diff options
author | Anders Svensson <[email protected]> | 2015-05-17 18:31:51 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2015-05-18 14:10:43 +0200 |
commit | 2599f843ccb48193348d75c287a9cfd507d09d08 (patch) | |
tree | ad43e9cb41381d9575491d6c8f82df12904295ad | |
parent | 0c2807d5f4ed72051c633c3ae9d3e88d8839a672 (diff) | |
download | otp-2599f843ccb48193348d75c287a9cfd507d09d08.tar.gz otp-2599f843ccb48193348d75c287a9cfd507d09d08.tar.bz2 otp-2599f843ccb48193348d75c287a9cfd507d09d08.zip |
Count discarded incoming messages
An incoming Diameter message is either a request, an answer to an
outstanding request, or an unexpected answer. The latter weren't
counted, but are now counted on keys of this form:
{pid(), {{unknown, 0}, recv, discarded}}
The form of the second element is similar to those of other counters,
like:
{{relay, 0|1}, send|recv, invalid_error_bit}
Compare this to the key used when counting known answers:
{{ApplicationId, CommandCode, 0}, recv}
The application id and command code aren't included so as not to count
on arbitrary keys, a topic last visited in commit 49e8b11c.
-rw-r--r-- | lib/diameter/src/base/diameter_traffic.erl | 3 | ||||
-rw-r--r-- | lib/diameter/test/diameter_relay_SUITE.erl | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl index 517daf6678..ad63e5b150 100644 --- a/lib/diameter/src/base/diameter_traffic.erl +++ b/lib/diameter/src/base/diameter_traffic.erl @@ -259,7 +259,8 @@ recv(false, #request{ref = Ref, handler = Pid} = Req, _, Pkt, Dict0, _) -> %% any others are discarded. %% ... or not. -recv(false, false, _, _, _, _) -> +recv(false, false, TPid, _, _, _) -> + incr(TPid, {{unknown, 0}, recv, discarded}), ok. %% spawn_request/4 diff --git a/lib/diameter/test/diameter_relay_SUITE.erl b/lib/diameter/test/diameter_relay_SUITE.erl index 5acea3cdb6..7142239bbb 100644 --- a/lib/diameter/test/diameter_relay_SUITE.erl +++ b/lib/diameter/test/diameter_relay_SUITE.erl @@ -259,6 +259,7 @@ stats(?CLIENT, L) -> {{{0,274,1},send},1}, %% ASR (send_loop) {{{0,275,0},recv},4}, %% STA (send[1-4]) {{{0,275,1},send},4}, %% STR (send[1-4]) + {{{unknown,0},recv,discarded},1}, %% RAR (send_timeout_2) {{{0,257,0},recv,{'Result-Code',2001}},2}, %% CEA {{{0,258,0},recv,{'Result-Code',3002}},1}, %% RAA (send_timeout_1) {{{0,274,0},recv,{'Result-Code',3005}},1}, %% ASA (send_loop) |