diff options
author | Anders Svensson <[email protected]> | 2013-03-19 13:17:30 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-03-19 13:17:30 +0100 |
commit | 53375f432c3ba5aa5a03bcbd2cb89caba6754113 (patch) | |
tree | 5fdb22d696d04821b296bd4da2aef8019a4dbaf7 /lib/diameter/test/diameter_stats_SUITE.erl | |
parent | 77c9f844f137deec2d49bd6c28ec03bce97d34df (diff) | |
parent | da15b3c5fdc9ff96b8d02f4620c879418648d45c (diff) | |
download | otp-53375f432c3ba5aa5a03bcbd2cb89caba6754113.tar.gz otp-53375f432c3ba5aa5a03bcbd2cb89caba6754113.tar.bz2 otp-53375f432c3ba5aa5a03bcbd2cb89caba6754113.zip |
Merge branch 'anders/diameter/reopen_abuse/OTP-10898' into maint-r16
* anders/diameter/reopen_abuse/OTP-10898:
Update appup
Tweak okay -> suspect config
Add testcases for watchdog_config
Rework watchdog suite to remove most timing dependencies
Rework stats to avoid concurrent read and write
Minor spec fix
Add transport_opt() watchdog_config
Diffstat (limited to 'lib/diameter/test/diameter_stats_SUITE.erl')
-rw-r--r-- | lib/diameter/test/diameter_stats_SUITE.erl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/diameter/test/diameter_stats_SUITE.erl b/lib/diameter/test/diameter_stats_SUITE.erl index af52afb59c..76ff764671 100644 --- a/lib/diameter/test/diameter_stats_SUITE.erl +++ b/lib/diameter/test/diameter_stats_SUITE.erl @@ -33,6 +33,7 @@ -export([reg/1, incr/1, read/1, + sum/1, flush/1]). -define(stat, diameter_stats). @@ -53,6 +54,7 @@ tc() -> [reg, incr, read, + sum, flush]. init_per_suite(Config) -> @@ -98,6 +100,23 @@ read(_) -> [] = ?stat:read([make_ref()]), ?stat:flush([self(), Ref, make_ref()]). +sum(_) -> + Ref = make_ref(), + C1 = {a,b}, + C2 = {b,a}, + true = ?stat:reg(Ref), + 1 = ?stat:incr(C1), + 1 = ?stat:incr(C2), + 2 = ?stat:incr(C2), + 7 = ?stat:incr(C1, Ref, 7), + [{Ref, [{C1,8}, {C2,2}]}] + = ?stat:sum([Ref, make_ref()]), + Self = self(), + [{Self, [{C1,1}, {C2,2}]}] + = ?stat:sum([self()]), + [{Ref, [{C1,7}]}, {Self, [{C1,1}, {C2,2}]}] + = lists:sort(?stat:flush([self(), Ref])). + flush(_) -> Ref = make_ref(), Ctr = '_', |