Added queue tracking

This commit is contained in:
Pünkösd Marcell 2021-11-18 18:15:03 +01:00
parent 497009da7e
commit e3d4fdcdae

View File

@ -88,6 +88,9 @@ class SlicedRecorder(Thread):
except Empty:
return None
def get_queue_length(self) -> int:
return self._output_queue.qsize()
def stop(self):
self._active = False
@ -104,6 +107,10 @@ class BirbnetesIoTPlatformRecordDriver:
def get_recording(cls, blocking: bool = False) -> Optional[str]:
return cls.sliced_recorder.get_recording(blocking)
@classmethod
def get_queue_length(cls) -> int:
return cls.sliced_recorder.get_queue_length()
@classmethod
def cleanup(cls):
cls.sliced_recorder.stop()