mirror of
https://github.com/wassname/sloth.git
synced 2026-08-05 13:20:52 +08:00
Log time needed to load annotations from disk
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
import fnmatch
|
||||
import time
|
||||
from sloth.core.exceptions import ImproperlyConfigured, NotImplementedException, InvalidArgumentException
|
||||
from sloth.core.utils import import_callable
|
||||
try:
|
||||
@@ -15,6 +16,8 @@ try:
|
||||
except:
|
||||
pass
|
||||
import okapy
|
||||
import logging
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
class AnnotationContainerFactory:
|
||||
def __init__(self, containers):
|
||||
@@ -78,7 +81,11 @@ class AnnotationContainer:
|
||||
if not filename:
|
||||
raise InvalidArgumentException("filename cannot be empty")
|
||||
self.filename_ = filename
|
||||
return self.parseFromFile(filename)
|
||||
start = time.time()
|
||||
ann = self.parseFromFile(filename)
|
||||
diff = time.time() - start
|
||||
LOG.info("Loaded annotations from %s in %.2fs" % (filename, diff))
|
||||
return ann
|
||||
|
||||
def parseFromFile(self, filename):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user