Print runtime of UISP Integration. Correct print statement before walkGraphOutwards()

This commit is contained in:
Robert Chacón 2023-04-21 02:01:19 -06:00 committed by GitHub
parent ee83b9f463
commit f5d6257652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ checkPythonVersion()
import requests
import os
import csv
from datetime import datetime, timedelta
from integrationCommon import isIpv4Permitted, fixSubnet
try:
from ispConfig import uispSite, uispStrategy, overwriteNetworkJSONalways
@ -333,7 +334,7 @@ def buildFullGraph():
if rootSite is None:
print("ERROR: Unable to find root site in UISP")
return
print('Creating graph')
print('Walking graph outwards')
walkGraphOutwards(siteList, rootSite, routeOverrides)
print("Finding PtMP Capacities")
siteList, nodeOffPtMP = findNodesBranchedOffPtMP(siteList, dataLinks, sites, rootSite, foundAirFibersBySite)
@ -449,6 +450,7 @@ def buildFullGraph():
"download": generatedPNDownloadMbps, "upload": generatedPNUploadMbps}
net.prepareTree()
print('Plotting network graph')
net.plotNetworkGraph(False)
if net.doesNetworkJsonExist():
if overwriteNetworkJSONalways:
@ -472,10 +474,13 @@ def buildFullGraph():
def importFromUISP():
startTime = datetime.now()
match uispStrategy:
case "full": buildFullGraph()
case default: buildFlatGraph()
endTime = datetime.now()
runTimeSeconds = ((endTime - startTime).seconds) + (((endTime - startTime).microseconds) / 1000000)
print("UISP import completed in " + "{:g}".format(round(runTimeSeconds,1)) + " seconds")
if __name__ == '__main__':
importFromUISP()