mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-06 10:18:42 +02:00
[stats] remove signal handling + misc fixes
* signal can only be used in the main thread, leading to an error when StatisticThread is instantiated inside a QThread * misc fixes on imports and variable names
This commit is contained in:
parent
5fc1d92cc2
commit
d190012d1d
1 changed files with 2 additions and 3 deletions
|
@ -1,8 +1,8 @@
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
import logging
|
||||||
import psutil
|
import psutil
|
||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
import signal
|
|
||||||
|
|
||||||
|
|
||||||
def bytes2human(n):
|
def bytes2human(n):
|
||||||
|
@ -174,7 +174,7 @@ class Statistics:
|
||||||
def fromDict(self, d):
|
def fromDict(self, d):
|
||||||
version = d.get('fileVersion', 1.0)
|
version = d.get('fileVersion', 1.0)
|
||||||
if version != self.fileVersion:
|
if version != self.fileVersion:
|
||||||
logging.info('Cannot load statistics, version was {} and we only support {}.'.format(version, fileVersion))
|
logging.info('Cannot load statistics, version was {} and we only support {}.'.format(version, self.fileVersion))
|
||||||
self.computer = {}
|
self.computer = {}
|
||||||
self.process = {}
|
self.process = {}
|
||||||
self.times = []
|
self.times = []
|
||||||
|
@ -190,7 +190,6 @@ bytesPerGiga = 1024. * 1024. * 1024.
|
||||||
class StatisticsThread(threading.Thread):
|
class StatisticsThread(threading.Thread):
|
||||||
def __init__(self, chunk):
|
def __init__(self, chunk):
|
||||||
threading.Thread.__init__(self)
|
threading.Thread.__init__(self)
|
||||||
signal.signal(signal.SIGINT, signal.SIG_IGN) # lambda signal, frame: self.stopRequest())
|
|
||||||
self.chunk = chunk
|
self.chunk = chunk
|
||||||
self.proc = psutil.Process() # by default current process pid
|
self.proc = psutil.Process() # by default current process pid
|
||||||
self.statistics = chunk.statistics
|
self.statistics = chunk.statistics
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue