def __init__(self, timing=None, wrapping=True): """""" self._timer = None if not timing is None: self.__increment = float(timing) / 100 if wrapping: self._timer = timer.timer("Producer timer begins", "Producer timer ends", "Total producer time") else: self._timer = timer.timer()
def __init__(self, timing=None, wrapping=True): """Config and init the timer.""" self.__timer = None if not timing is None: self.__increment = float(timing) / 100 if wrapping: self.__timer = timer.timer("Producer timer begins", "Producer timer ends", "Total producer time") else: self.__timer = timer.timer()
def __init__(self, timing=None, wrapping=True): """Config and init the timer.""" self.__timer = None self.logger = logging.Logger("producer") handler = logging.StreamHandler() handler.setFormatter(logging.Formatter("%(name)s %(asctime)s %(message)s")) self.logger.addHandler(handler) self.logger.setLevel(logging.DEBUG) if not timing is None: self.__increment = float(timing) / 100 if wrapping: self.__timer = timer.timer("Producer timer begins", "Producer timer ends", "Total producer time") else: self.__timer = timer.timer() self.metadata = None
def main(project, options): # get the options file = options.file timing = options.timing # set the file names if timing: myTimer = timer.timer(start="Beginning timing", total="Lifetime of timer") base = file + "." analysis = project.speedExample config = analysis.producer + (base + "xml") inPmml = analysis.producer + (base + "pmml") outPmml = analysis.consumer + (base + "pmml") table = project.data + file # make the configurations according to the data if timing: myTimer.output("Creating configuration file") makeConfigs(table, config, inPmml, outPmml) # make the input pmml if timing: myTimer.output("Creating input PMML file") makePMML(inPmml) # call the producer if timing: myTimer.output("Starting producer") Producer.main(config, timing, False) if timing: del myTimer
def main(project, options): #get the options file = options.file timing = options.timing #set the file names if timing: myTimer = timer.timer(start="Beginning timing", total="Lifetime of timer") base = file + "." analysis = project.volumeExample config = analysis.producer + (base + "xml") inPmml = analysis.producer + (base + "pmml") outPmml = analysis.consumer + (base + "pmml") table = project.data + file #make the configurations according to the data if timing: myTimer.output("Creating configuration file") makeConfigs(table, config, inPmml, outPmml) #make the input pmml if timing: myTimer.output("Creating input PMML file") makePMML(inPmml) #call the producer if timing: myTimer.output("Starting producer") Producer.main(config, timing, False) if timing: del myTimer