def subclassinit(self): cwd = os.getcwd() if cwd.find('blong') != -1: self.setPaths(["/home/blong/netcon/nc_server/tmpl"]) else: self.setPaths(["/home/jeske/netcon/nc_server/tmpl"]) self.ndb = db_netcon.netcon_connect() if self.ncgi.hdf.getValue("Query.debug","") == "1": self.ncgi.hdf.setValue("page.debug","1")
def main(): ndb = db_netcon.netcon_connect() # 0. load data # 1. Compute linear interp and stdv # 2. is recent/current data within stdv range? # 3. if not, shorten time and repeat # 4. if yes, compute time to trend target # ----------------------- # 0. load data h_data = ndb.monitor_history.fetchRows([("serv_id", 4), ("source_id", 6)]) # 1. Compute linear interp and stdv # try_nlregress(h_data) try_simplex(h_data) try_linreg(h_data)
def __init__(self): # connect self.ndb = db_netcon.netcon_connect()