From 2599f843ccb48193348d75c287a9cfd507d09d08 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Sun, 17 May 2015 18:31:51 +0200 Subject: 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. --- lib/diameter/src/base/diameter_traffic.erl | 3 ++- lib/diameter/test/diameter_relay_SUITE.erl | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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) -- cgit v1.2.3