def __init__(self): self.target_record_fields = set() self.datasources = {} self.explicit_datasource_lookup_functions = {} self.field_map = {} self.value_map = FieldValueMap() self.output_header = [] self.event_handlers = {} self.error_handlers = {} self.count_log = jrnl.CountLog() # this stat will show zero unless the process() method is called. # We do not record time stats for individual calls to the transform() method; # "processing_time" is the time spent in the process() method, which invokes transform() # once per inbound record. # # We initialize the elapsed processing time to zero by default. self.time_log = jrnl.TimeLog() current_time = datetime.datetime.now() self.time_log.record_elapsed_time('processing_time', current_time, current_time)
def reset_logs(self): self.time_log = jrnl.TimeLog() self.count_log = jrnl.CountLog()