Skip to content

Commit

Permalink
Rename advertiser_add/advertiser_start's reconnect interval attribute
Browse files Browse the repository at this point in the history
Change the attribute name to 'reconnect_interval' for consistency with
the attributes in prdcr_add, prdcr_start, and prdcr_start_regex
  • Loading branch information
nichamon committed Nov 12, 2024
1 parent 0ccee83 commit b960214
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 21 deletions.
111 changes: 111 additions & 0 deletions ldms/man/ldmsd_controller.man
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,117 @@ The regular expression matching producer name
The stream name
.RE

.SH ADVERTISER COMMAND SYNTAX
.SS Add an advertiser that will send a connect request to an aggregator. LDMS daemon will periodically reconnect to the aggregator as long as the connection is not established.
.BR advertiser_add
attr=<value>
.RS
.TP
.BI name " name"
.br
The advertiser name, which will be the producer name on the aggregator.
.TP
.BI xprt " xprt"
.br
Transport name
.TP
.BI host " host"
.br
Aggregator hostname
.TP
.BI port " port"
.br
Aggregator listening port
.TP
.BI reconnect_interval " interval"
.br
The connection retry interval, which is a float followed by a unit string.
If no unit string is given, the default unit is microseconds.
A unit string is one of the followings:
us -- microseconds
ms -- milliseconds
s -- seconds
m -- minutes
h -- hours
d -- days
.TP
.BI [perm " permission"]
.br
The permission to modify the producer in the future
.TP
.BI [auth " AUTH_REF"]
.br
Instruct \fBldmsd\fR to use \fIAUTH_REF\fR (a name reference to \fBauth\fR
object created by \fBauth_add\fR command) with the connections to this
producer. If not given, the default authentication method specified on
the CLI options (see \fBldmsd\fR(8) option \fB-a\fR) is used.
.RE

.SS Start an advertiser. If the advertiser does not exist, the advertiser will be added if all mandatory attributes of \fBadvertiser_add\fR are given and then started.
.BR advertiser_start
attr=<value>
.RS
.TP
.BI name " name"
.br
The advertiser name
.TP
.BI [xprt " xprt]"
.br
Transport name
.TP
.BI [host " host]"
.br
Aggregator hostname
.TP
.BI [port " port]"
.br
Aggregator listening port
.TP
.BI [reconnect_interval " interval]"
.br
The connection retry interval, which is a float followed by a unit string.
If no unit string is given, the default unit is microseconds.
A unit string is one of the followings:
us -- microseconds
ms -- milliseconds
s -- seconds
m -- minutes
h -- hours
d -- days
.TP
.BI [perm " permission"]
.br
The permission to modify the producer in the future
.TP
.BI [auth " AUTH_REF"]
.br
Instruct \fBldmsd\fR to use \fIAUTH_REF\fR (a name reference to \fBauth\fR
object created by \fBauth_add\fR command) with the connections to this
producer. If not given, the default authentication method specified on
the CLI options (see \fBldmsd\fR(8) option \fB-a\fR) is used.
.RE

.SS Stop an advertiser
.BR advertiser_stop
attr=<value>
.RS
.TP
.BI name " name"
.br
The advertiser name
.RE

.SS Delete an advertiser
.BR advertiser_del
attr=<value>
.RS
.TP
.BI name " name"
.br
The advertiser name
.RE

.SH UPDATER COMMAND SYNTAX
.SS Add an updater process that will periodically sample producer metric sets
.BR updtr_add
Expand Down
4 changes: 2 additions & 2 deletions ldms/python/ldmsd/ldmsd_communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@
'auth_add': {'req_attr' : ['name', 'plugin'], 'opt_attr': []
},
##### Sampler Discovery #####
'advertiser_add': {'req_attr': ['name', 'xprt', 'host', 'port', 'reconnect'],
'advertiser_add': {'req_attr': ['name', 'xprt', 'host', 'port', 'reconnect_interval'],
'opt_attr' : [ 'auth', 'perm' ] },
'advertiser_del': {'req_attr': ['name'], 'opt_attr': []},
'advertiser_start': {'req_attr': ['name'],
'opt_attr' : ['xprt', 'host', 'port',
'auth', 'perm', 'reconnect' ] },
'auth', 'perm', 'reconnect_interval' ] },
'advertiser_stop': {'req_attr': ['name'], 'opt_attr': []},
'prdcr_listen_add': {'req_attr': ['name'],
'opt_attr': ['ip', 'regex', 'disable_start']},
Expand Down
36 changes: 17 additions & 19 deletions ldms/python/ldmsd/ldmsd_controller
Original file line number Diff line number Diff line change
Expand Up @@ -2256,29 +2256,27 @@ class LdmsdCmdParser(cmd.Cmd):
This is a part of the sampler discovery feature.
An advertiser advertises its existense to an aggregator.
Parameters:
name= A unique name to be used as producer name on the aggregator
xprt= The transport name [sock, rdma, ugni]
host= The aggregator hostname
port= The aggregator listening port number
reconnect= The connection retry interval
[auth=] The authentication domain of the remote daemon
[perm=] The permission to modify the advertiser in the future
name= A unique name to be used as producer name on the aggregator
xprt= The transport name [sock, rdma, ugni]
host= The aggregator hostname
port= The aggregator listening port number
reconnect_interval= The connection retry interval
[auth=] The authentication domain of the remote daemon
[perm=] The permission to modify the advertiser in the future
"""
arg = self.handle_args('advertiser_add', arg)
if arg is None:
return
if arg['reconnect'] is None:
print(f"The attribute 'reconnect' is missing.")
else:
rc, msg = self.comm.advertiser_add(arg['name'],
arg['xprt'],
arg['host'],
arg['port'],
arg['reconnect'],
arg['auth'],
arg['perm'])
if rc:
print(f'Error adding advertiser {arg["name"]}: {msg}')

rc, msg = self.comm.advertiser_add(arg['name'],
arg['xprt'],
arg['host'],
arg['port'],
arg['reconnect_interval'],
arg['auth'],
arg['perm'])
if rc:
print(f'Error adding advertiser {arg["name"]}: {msg}')

def complete_advertiser_add(self, text, line, begidx, endidx):
return self.__complete_attr_list('advertiser_add', text)
Expand Down

0 comments on commit b960214

Please sign in to comment.