From 6ec4f6cceb2e848663911650637c5b161e64ff70 Mon Sep 17 00:00:00 2001 From: Michal Mielewczyk Date: Wed, 2 Oct 2024 14:43:20 +0200 Subject: [PATCH] pyocf: rio: reads and writes accounting Signed-off-by: Michal Mielewczyk --- tests/functional/pyocf/rio.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/functional/pyocf/rio.py b/tests/functional/pyocf/rio.py index ec9e3fd..c811eea 100644 --- a/tests/functional/pyocf/rio.py +++ b/tests/functional/pyocf/rio.py @@ -87,6 +87,8 @@ class Rio: self.ios = Size(0) self.io_target = 0 self.finish_time = None + self.submitted_reads = 0 + self.submitted_writes = 0 self.qd_condition = Condition() self.qd = 0 @@ -159,6 +161,12 @@ class Rio: io.callback = self.get_io_cb() self.ios += self.jobspec.bs io.submit() + + if iodir is IoDir.WRITE: + self.submitted_writes += 1 + if iodir is IoDir.READ: + self.submitted_reads += 1 + with self.qd_condition: self.qd += 1 @@ -172,6 +180,8 @@ class Rio: self._threads = [] self.errors = {} self.error_count = 0 + self.submitted_reads = 0 + self.submitted_writes = 0 def copy(self): r = copy.copy(self) @@ -254,6 +264,8 @@ class Rio: thread.join() self.errors.update({thread.name: thread.errors}) self.error_count += len(thread.errors) + self.submitted_reads += thread.submitted_reads + self.submitted_writes += thread.submitted_writes self.global_jobspec.target.close()