Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
8175-diameter-Update-spec-s.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 8175-diameter-Update-spec-s.patch of Package erlang
From 187cfd4c87f1807399b85fba2face13d9922fa75 Mon Sep 17 00:00:00 2001 From: Micael Karlberg <bmk@erlang.org> Date: Mon, 25 Mar 2024 17:44:21 +0100 Subject: [PATCH 5/5] [diameter] Update spec(s) OTP-19040 --- lib/diameter/doc/src/diameter.xml | 48 ++++++++++++++------ lib/diameter/src/base/diameter.erl | 51 ++++++++++++++-------- lib/diameter/src/base/diameter_service.erl | 12 +---- 3 files changed, 68 insertions(+), 43 deletions(-) diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index bfbc405712..bc8c3fab3c 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -23,7 +23,7 @@ <copyright> <year>2011</year> -<year>2020</year> +<year>2024</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -108,6 +108,14 @@ in this module.</p> Types corresponding to &the_rfc; AVP Data Formats. Defined in &dict_data_types;.</p> +<marker id="elapsed_time"/> +</item> + +<tag><c>elapsed_time()</c></tag> +<item> +<p> +Elapsed time since a given time.</p> + <marker id="application_alias"/> </item> @@ -1828,15 +1836,22 @@ configured on the transport.</p> <!-- ===================================================================== --> <func> -<name since="OTP 25.X">which_connections() -> [SvcConnections]</name> +<name since="OTP 25.0">which_connections() -> [SvcConnections]</name> <fsummary>Returns a list of connections.</fsummary> <type> <v>SvcConnections = {SvcName, [Connection]}</v> <v>SvcName = string()</v> - <v>Connection = #{peer := term(), - wd := term(), + <v>Connection = #{peer := PeerInfo, + wd := WDInfo, peername := Address, sockname := Address}</v> + <v>PeerInfo = #{pid := pid(), + uptime := elapsed_time()}</v> + <v>WDInfo = #{ref := reference(), + type := atom(), + pid := pid(), + state := diameter_service:wd_state(), + uptime := elapsed_time()}</v> <v>Address = {inet:ip_address(), inet:port_number()}</v> </type> <desc> @@ -1848,14 +1863,21 @@ configured on the transport.</p> </func> <func> -<name since="OTP 25.X">which_connections(SvcName) -> [Connection]</name> +<name since="OTP 25.0">which_connections(SvcName) -> [Connection]</name> <fsummary>Returns a list of connections.</fsummary> <type> <v>SvcName = string()</v> - <v>Connection = #{peer := term(), - wd := term(), + <v>Connection = #{peer := PeerInfo, + wd := WDInfo, peername := Address, sockname := Address}</v> + <v>PeerInfo = #{pid := pid(), + uptime := elapsed_time()}</v> + <v>WDInfo = #{ref := reference(), + type := atom(), + pid := pid(), + state := diameter_service:wd_state(), + uptime := elapsed_time()}</v> <v>Address = {inet:ip_address(), inet:port_number()}</v> </type> <desc> @@ -1868,7 +1890,7 @@ Return a list of connections associated with the service 'SvcName'. </p> <!-- ===================================================================== --> <func> -<name since="OTP 25.X">which_transports() -> [Transport]</name> +<name since="OTP 25.0">which_transports() -> [Transport]</name> <fsummary>Returns a list of transports.</fsummary> <type> <v>Transport = #{ref := reference(), @@ -1884,7 +1906,7 @@ Return a list of <em>all</em> transports. </p> </func> <func> -<name since="OTP 25.X">which_transports(SvcName) -> [Transport]</name> +<name since="OTP 25.0">which_transports(SvcName) -> [Transport]</name> <fsummary>Returns a list of transports.</fsummary> <type> <v>SvcName = string()</v> @@ -1901,7 +1923,7 @@ Return a list of transports associated with the service 'SvcName'. </p> <!-- ===================================================================== --> <func> -<name since="OTP 25.X">which_watchdogs() -> [Watchdog]</name> +<name since="OTP 25.0">which_watchdogs() -> [Watchdog]</name> <fsummary>Returns a list of watchdogs.</fsummary> <type> <v>Watchdog = #{ref := reference(), @@ -1909,7 +1931,7 @@ Return a list of transports associated with the service 'SvcName'. </p> pid := pid(), state := diameter_service:wd_state(), peer := boolean() | pid(), - uptime := {Hours, Mins, Secs, MicroSecs} + uptime := elapsed_time(), service := SvcName}</v> <v>SvcName = string()</v> </type> @@ -1921,7 +1943,7 @@ Return a list of <em>all</em> watchdogs. </p> </func> <func> -<name since="OTP 25.X">which_watchdogs(SvcName) -> [Transport]</name> +<name since="OTP 25.0">which_watchdogs(SvcName) -> [Transport]</name> <fsummary>Returns a list of watchdogs.</fsummary> <type> <v>SvcName = string()</v> @@ -1930,7 +1952,7 @@ Return a list of <em>all</em> watchdogs. </p> pid := pid(), state := diameter_service:wd_state(), peer := boolean() | pid(), - uptime := {Hours, Mins, Secs, MicroSecs}</v> + uptime := elapsed_time()</v> </type> <desc> <p> diff --git a/lib/diameter/src/base/diameter.erl b/lib/diameter/src/base/diameter.erl index 0d12dcc196..05835896fd 100644 --- a/lib/diameter/src/base/diameter.erl +++ b/lib/diameter/src/base/diameter.erl @@ -68,7 +68,8 @@ transport_ref/0, transport_opt/0, transport_pred/0, - call_opt/0]). + call_opt/0, + elapsed_time/0]). -export_type(['OctetString'/0, 'Integer32'/0, @@ -240,13 +241,9 @@ which_transports(SvcName) -> pid := pid(), state := diameter_service:wd_state(), peer := boolean() | pid(), - uptime := {Hours, Mins, Secs, MicroSecs}, + uptime := elapsed_time(), service := SvcName}] when - Hours :: non_neg_integer(), - Mins :: 0..59, - Secs :: 0..59, - MicroSecs :: 0..999999, - SvcName :: string(). + SvcName :: string(). which_watchdogs() -> diameter_service:which_watchdogs(). @@ -258,12 +255,8 @@ which_watchdogs() -> pid := pid(), state := diameter_service:wd_state(), peer := boolean() | pid(), - uptime := {Hours, Mins, Secs, MicroSecs}}] when - SvcName :: string(), - Hours :: non_neg_integer(), - Mins :: 0..59, - Secs :: 0..59, - MicroSecs :: 0..999999. + uptime := elapsed_time()}] when + SvcName :: string(). which_watchdogs(SvcName) -> diameter_service:which_watchdogs(SvcName). @@ -275,21 +268,35 @@ which_watchdogs(SvcName) -> -spec which_connections() -> [{SvcName, - [#{peer := term(), - wd := term(), + [#{peer := PeerInfo, + wd := WDInfo, peername := {inet:ip_address(), inet:port_number()}, sockname := {inet:ip_address(), inet:port_number()}}]}] when - SvcName :: string(). + SvcName :: string(), + PeerInfo :: #{pid := pid(), + uptime := elapsed_time()}, + WDInfo :: #{ref := reference(), + type := atom(), + pid := pid(), + state := diameter_service:wd_state(), + uptime := elapsed_time()}. which_connections() -> diameter_service:which_connections(). -spec which_connections(SvcName) -> - [#{peer := term(), - wd := term(), + [#{peer := PeerInfo, + wd := WDInfo, peername := {inet:ip_address(), inet:port_number()}, sockname := {inet:ip_address(), inet:port_number()}}] when - SvcName :: string(). + SvcName :: string(), + PeerInfo :: #{pid := pid(), + uptime := elapsed_time()}, + WDInfo :: #{ref := reference(), + type := atom(), + pid := pid(), + state := diameter_service:wd_state(), + uptime := elapsed_time()}. which_connections(SvcName) -> diameter_service:which_connections(SvcName). @@ -537,3 +544,9 @@ call(SvcName, App, Message) -> | {filter, peer_filter()} | {peer, peer_ref()} | {timeout, 'Unsigned32'()}. + +-type elapsed_time() :: + {Hours :: non_neg_integer(), + Mins :: 0..59, + Secs :: 0..59, + MicroSecs :: 0..999999}. diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index a2a3771270..6e134194d0 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -310,8 +310,7 @@ connection_info(PT, #watchdog{pid = Pid, pid => Pid, type => Type, state => State, - uptime => diameter_lib:now_diff(Started)} - }, + uptime => diameter_lib:now_diff(Started)}}, connection_info2(PT, TPid, State, Info). connection_info2(PT, TPid, State, Info) @@ -2162,15 +2161,6 @@ info_stats(#state{watchdogT = WatchdogT}) -> %% the accumulated values for the ref and associated watchdog/peer %% pids. -%% foo() -> -%% #{ref :: reference(), -%% type :: connect | listen, -%% transport_module :: module(), -%% wd :: {pid(), integer(), wd_state()}, -%% peer :: {pid(), Started :: integer()}, -%% local :: {inet:ip_address(), inet:port_number()}, -%% remote :: {inet:ip_address(), inet:port_number()}}. - info_transport(S, _) -> PeerD = peer_dict(S, config_dict(S)), Stats = diameter_stats:sum(dict:fetch_keys(PeerD)), -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor