ttime = float with us to ms resolution
This commit is contained in:
parent
284b0c1f38
commit
8c8fdba7c8
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
import os # todo: remove this once import_dir is in fpdb_import
|
import os # todo: remove this once import_dir is in fpdb_import
|
||||||
import sys
|
import sys
|
||||||
from time import time, strftime, sleep
|
from time import time, strftime, sleep, clock
|
||||||
import traceback
|
import traceback
|
||||||
import math
|
import math
|
||||||
import datetime
|
import datetime
|
||||||
|
@ -101,6 +101,8 @@ class Importer:
|
||||||
|
|
||||||
self.NEWIMPORT = Configuration.NEWIMPORT
|
self.NEWIMPORT = Configuration.NEWIMPORT
|
||||||
|
|
||||||
|
clock() # init clock in windows
|
||||||
|
|
||||||
#Set functions
|
#Set functions
|
||||||
def setCallHud(self, value):
|
def setCallHud(self, value):
|
||||||
self.callHud = value
|
self.callHud = value
|
||||||
|
@ -365,7 +367,7 @@ class Importer:
|
||||||
(stored, duplicates, partial, errors, ttime) = self.import_file_dict(self.database, file, self.filelist[file][0], self.filelist[file][1], None)
|
(stored, duplicates, partial, errors, ttime) = self.import_file_dict(self.database, file, self.filelist[file][0], self.filelist[file][1], None)
|
||||||
try:
|
try:
|
||||||
if not os.path.isdir(file):
|
if not os.path.isdir(file):
|
||||||
self.caller.addText(" %d stored, %d duplicates, %d partial, %d errors (time = %d)" % (stored, duplicates, partial, errors, ttime))
|
self.caller.addText(" %d stored, %d duplicates, %d partial, %d errors (time = %f)" % (stored, duplicates, partial, errors, ttime))
|
||||||
except KeyError: # TODO: Again, what error happens here? fix when we find out ..
|
except KeyError: # TODO: Again, what error happens here? fix when we find out ..
|
||||||
pass
|
pass
|
||||||
self.updatedsize[file] = stat_info.st_size
|
self.updatedsize[file] = stat_info.st_size
|
||||||
|
@ -477,10 +479,13 @@ class Importer:
|
||||||
self.pos_in_file[file] = inputFile.tell()
|
self.pos_in_file[file] = inputFile.tell()
|
||||||
inputFile.close()
|
inputFile.close()
|
||||||
|
|
||||||
|
x = clock()
|
||||||
(stored, duplicates, partial, errors, ttime, handsId) = self.import_fpdb_lines(db, self.lines, starttime, file, site, q)
|
(stored, duplicates, partial, errors, ttime, handsId) = self.import_fpdb_lines(db, self.lines, starttime, file, site, q)
|
||||||
|
|
||||||
db.commit()
|
db.commit()
|
||||||
ttime = time() - starttime
|
y = clock()
|
||||||
|
ttime = y - x
|
||||||
|
#ttime = time() - starttime
|
||||||
if q is None:
|
if q is None:
|
||||||
log.info("Total stored: %(stored)d\tduplicates:%(duplicates)d\terrors:%(errors)d\ttime:%(ttime)s" % locals())
|
log.info("Total stored: %(stored)d\tduplicates:%(duplicates)d\terrors:%(errors)d\ttime:%(ttime)s" % locals())
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user