Adding more debug statements in ECA system

This commit is contained in:
Mark Veidemanis 2022-08-11 20:36:24 +01:00
parent d38f7ba1ba
commit dc13515aa8
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,7 @@ def emptyChanAllocate(net, flist, relay, new):
toalloc = len(flist) toalloc = len(flist)
if toalloc > sum(chanfree[0].values()): if toalloc > sum(chanfree[0].values()):
correction = round(toalloc - sum(chanfree[0].values()) / chanfree[1]) correction = round(toalloc - sum(chanfree[0].values()) / chanfree[1])
debug(f"emptyChanAllocate() not enough free channels: toalloc:{toalloc} free:{chanfree[0]} chanlimit:{chanfree[1]} correction:{correction}")
warn("Ran out of channel spaces, provisioning additional %i relays for %s" % (correction, net)) warn("Ran out of channel spaces, provisioning additional %i relays for %s" % (correction, net))
modules.provision.provisionMultipleRelays(net, correction) modules.provision.provisionMultipleRelays(net, correction)
return False return False
@ -133,11 +134,13 @@ def keepChannels(net, listinfo, mean, sigrelay, relay):
return return
if coverAll: if coverAll:
needed = relay - len(getActiveRelays(net)) needed = relay - len(getActiveRelays(net))
debug(f"keepChannels() coverAll asking to provision {needed} relays for {net} relay:{relay}")
newNums = modules.provision.provisionMultipleRelays(net, needed) newNums = modules.provision.provisionMultipleRelays(net, needed)
flist = [i[0] for i in listinfo] flist = [i[0] for i in listinfo]
populateChans(net, flist, relay, newNums) populateChans(net, flist, relay, newNums)
else: else:
needed = sigrelay - len(getActiveRelays(net)) needed = sigrelay - len(getActiveRelays(net))
debug(f"keepChannels() NOT coverAll asking to provision {needed} relays for {net} sigrelay:{sigrelay}")
newNums = modules.provision.provisionMultipleRelays(net, needed) newNums = modules.provision.provisionMultipleRelays(net, needed)
siglist = [i[0] for i in listinfo if int(i[1]) > mean] siglist = [i[0] for i in listinfo if int(i[1]) > mean]
populateChans(net, siglist, sigrelay, newNums) populateChans(net, siglist, sigrelay, newNums)