Ejemplo n.º 1
0
 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()
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
 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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
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