Skip to content

Commit

Permalink
Update advertiser and prdcr_listen command map
Browse files Browse the repository at this point in the history
Doc updates and attribute mapping for advertiser and prdcr_listen commands
  • Loading branch information
nick-enoent authored and tom95858 committed Jul 26, 2024
1 parent 47766cb commit 60ebdcc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 25 deletions.
28 changes: 14 additions & 14 deletions ldms/python/ldmsd/ldmsd_communicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,18 @@
'auth_add': {'req_attr': ['name'],
'opt_attr' : ['plugin', 'auth_opt'] },
##### Sampler Discovery #####
'advertiser_add': {'req_attr': ['name', 'xprt', 'host', 'port'],
'advertiser_add': {'req_attr': ['name', 'xprt', 'host', 'port', 'reconnect'],
'opt_attr' : ['auth', 'perm', 'interval',
'reconnect', 'rail',
'credits', 'rx_rate' ] },
'rail', 'credits', 'rx_rate' ] },
'advertiser_del': {'req_attr': ['name'], 'opt_attr': []},
'advertiser_start': {'req_attr': ['name'],
'opt_attr' : ['xprt', 'host', 'port',
'auth', 'perm',
'reconnect', 'rail',
'credits', 'rx_rate' ] },
'advertiser_stop': {'req_attr': ['name'], 'opt_attr': []},
'prdcr_listen_add': {'req_attr': ['name'],
'opt_attr': ['ip', 'regex', 'disable_start']},
'prdcr_listen_add': {'req_attr': ['name', 'reconnect'],
'opt_attr': ['rail', 'ip', 'credits', 'rx_rate', 'regex', 'disable_start']},
'prdcr_listen_del': {'req_attr': ['name'], 'opt_attr': []},
'prdcr_listen_start': {'req_attr': ['name'], 'opt_attr': []},
'prdcr_listen_stop': {'req_attr': ['name'], 'opt_attr': []},
Expand Down Expand Up @@ -2455,7 +2454,7 @@ def prdcr_hint_tree(self, name=None):
return errno.ENOTCONN, str(e)

def advertiser_add(self, name, xprt, host, port, reconnect, auth=None, perm=None,
rail=None, credits=None, rx_rate=None):
rail=None, credits=None, rx_rate=None):
"""
Add an advertiser. An advertiser sends an advertisement to an aggregator
add it as a producer. Once started, the LDSMD will attempt to
Expand All @@ -2472,7 +2471,7 @@ def advertiser_add(self, name, xprt, host, port, reconnect, auth=None, perm=None
- The reconnect interval in microseconds
Keyword Parameters:
auth - The authentication demain
auth - The authentication domain of the remote daemon
perm - The configuration client permission required to
modify the producer configuration. Default is None.
rail - The number of endpoints in a rail. The default is 1.
Expand All @@ -2491,7 +2490,7 @@ def advertiser_add(self, name, xprt, host, port, reconnect, auth=None, perm=None
'reconnect': reconnect, 'auth': auth, 'perm': perm,
'rail': rail, 'credits': credits, 'rx_rate': rx_rate}
attrs = self._prdcr_add_attr_prep(**args_d)
attrs.append(LDMSD_Req_Attr(attr_id=LDMSD_Req_Attr.TYPE, value="advertise"))
attrs.append(LDMSD_Req_Attr(attr_id=LDMSD_Req_Attr.TYPE, value="advertiser"))
req = LDMSD_Request( command_id = LDMSD_Request.ADVERTISER_ADD, attrs = attrs)
try:
req.send(self)
Expand All @@ -2502,8 +2501,8 @@ def advertiser_add(self, name, xprt, host, port, reconnect, auth=None, perm=None
return errno.ENOTCONN, str(e)

def advertiser_start(self, name, xprt=None, host=None, port=None,
reconnect=None, auth=None, perm=None,
rail=None, credits=None, rx_rate=None):
reconnect=None, auth=None, perm=None,
rail=None, credits=None, rx_rate=None):
"""
Start an advertiser. If the advertiser does not exist, LDMSD will create it.
In this case, the values of the required attributes in advertiser_add must be given.
Expand Down Expand Up @@ -2535,7 +2534,7 @@ def advertiser_start(self, name, xprt=None, host=None, port=None,
'reconnect': reconnect, 'auth': auth, 'perm': perm,
'rail': rail, 'credits': credits, 'rx_rate': rx_rate}
attrs = self._prdcr_add_attr_prep(**args_d)
attrs.append(LDMSD_Req_Attr(attr_id=LDMSD_Req_Attr.TYPE, value="advertise"))
attrs.append(LDMSD_Req_Attr(attr_id=LDMSD_Req_Attr.TYPE, value="advertiser"))
req = LDMSD_Request( command_id = LDMSD_Request.ADVERTISER_START, attrs = attrs)
try:
req.send(self)
Expand Down Expand Up @@ -2567,12 +2566,13 @@ def advertiser_del(self, name):
self.close()
return errno.ENOTCONN, str(e)

def prdcr_listen_add(self, name, disable_start=None, regex=None, ip=None):
def prdcr_listen_add(self, name, reconnect, disable_start=None, regex=None, ip=None, rail=None, credits=None, rx_rate=None):
"""
Tell an aggregator to wait for advertisements from samplers
The ggregator automatically adds and starts a producer when it receives
an advertisement that the peer (sampler) hostname matches the regular expression.
The aggregator automatically adds and starts a producer when it receives
an advertisement that the peer (sampler) hostname matches the regular expression
unless the disable_start parameter is specified.
Parameters:
- Name of the producer listen
Expand Down
31 changes: 20 additions & 11 deletions ldms/python/ldmsd/ldmsd_controller
Original file line number Diff line number Diff line change
Expand Up @@ -2819,13 +2819,14 @@ class LdmsdCmdParser(cmd.Cmd):
"""
Add an advertisement of its hostname to an aggregator. This is a part of the sampler discovery feature.
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
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 port number
reconnect= The connection retry interval
[auth=] The authentication method
[perm=] The permission to modify the producer in the future.
[rail=] The number of rail endpoints for the prdcr (default: 1).
[auth=] The authentication method
[perm=] The permission to modify the producer in the future.
[rail=] The number of rail endpoints for the prdcr (default: 1).
[credits=] The send credits our ldmsd (the one we are controlling)
advertises to the prdcr (default: value from ldmsd --credits
option). This limits how much outstanding data our ldmsd
Expand All @@ -2851,7 +2852,7 @@ class LdmsdCmdParser(cmd.Cmd):
arg['credits'],
arg['rx_rate'])
if rc:
print(f'Error adding Bridge {arg["name"]}: {msg}')
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 Expand Up @@ -2918,7 +2919,7 @@ class LdmsdCmdParser(cmd.Cmd):
print("Name Aggregator Host Aggregator Port Transport Reconnect(us) State")
print("---------------- ---------------- --------------- ------------ --------------- ------------")
for prdcr in producers:
if prdcr['type'] != 'advertise':
if prdcr['type'] != 'advertiser':
continue
print(f"{prdcr['name']:16} {prdcr['host']:16} {prdcr['port']:<15} " \
f"{prdcr['transport']:12} {prdcr['reconnect_us']:15} " \
Expand All @@ -2944,10 +2945,18 @@ class LdmsdCmdParser(cmd.Cmd):
prdcr_stop and prdcr_start, respectively, as manually added producers.
Parameters:
name= A unique name of the producer listen
reconnect= The retry interval to check for connection establishment of producers matched the regular expression.
name= A unique name of the producer listen
reconnect= The retry interval to check for connection establishment of producers matched the regular expression.
[disable_start=] Tell LDMSD not to start the producers
[regex=] A regular expression to match sampler hostnames
[regex=] A regular expression to match sampler hostnames
[rail=] The number of rail endpoints for the prdcr (default: 1).
[credits=] The send credits our ldmsd (the one we are controlling)
advertises to the prdcr (default: value from ldmsd --credits
option). This limits how much outstanding data our ldmsd
holds for the prdcr. The prdcr drops messages when it does
not have enough send credits.
[rx_rate=] The recv rate (bytes/sec) limit for this connection. The
default is -1 (unlimited).
"""
arg = self.handle_args('prdcr_listen_add', arg)
if arg is None:
Expand Down

0 comments on commit 60ebdcc

Please sign in to comment.