From: yong.huang@smartx.com
To: qemu-devel <qemu-devel@nongnu.org>
Cc: "Fabiano Rosas" <farosas@suse.de>, "Peter Xu" <peterx@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Hyman Huang" <yong.huang@smartx.com>
Subject: [PATCH v4 RESEND 4/4] guestperf: Add test result data into report
Date: Fri, 14 Feb 2025 18:55:26 +0800 [thread overview]
Message-ID: <6303400c2983ffe5647f07caa6406f00ceae4581.1739530098.git.yong.huang@smartx.com> (raw)
In-Reply-To: <cover.1739530098.git.yong.huang@smartx.com>
From: Hyman Huang <yong.huang@smartx.com>
The migration result data is not included in the guestperf
report information; include the result as a report entry
so the developer can check whether the migration was successful
after running guestperf.
Signed-off-by: Hyman Huang <yong.huang@smartx.com>
---
tests/migration-stress/guestperf/engine.py | 10 ++++++++--
tests/migration-stress/guestperf/report.py | 20 ++++++++++++++++++++
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/tests/migration-stress/guestperf/engine.py b/tests/migration-stress/guestperf/engine.py
index e11f6a8496..d8462db765 100644
--- a/tests/migration-stress/guestperf/engine.py
+++ b/tests/migration-stress/guestperf/engine.py
@@ -24,7 +24,7 @@
import time
from guestperf.progress import Progress, ProgressStats
-from guestperf.report import Report
+from guestperf.report import Report, ReportResult
from guestperf.timings import TimingRecord, Timings
sys.path.append(os.path.join(os.path.dirname(__file__),
@@ -276,7 +276,11 @@ def _migrate(self, hardware, scenario, src,
src_vcpu_time.extend(self._vcpu_timing(src_pid, src_threads))
sleep_secs -= 1
- return [progress_history, src_qemu_time, src_vcpu_time]
+ result = ReportResult()
+ if progress._status == "completed" and not paused:
+ result = ReportResult(True)
+
+ return [progress_history, src_qemu_time, src_vcpu_time, result]
if self._verbose and (loop % 20) == 0:
print("Iter %d: remain %5dMB of %5dMB (total %5dMB @ %5dMb/sec)" % (
@@ -490,6 +494,7 @@ def run(self, hardware, scenario, result_dir=os.getcwd()):
progress_history = ret[0]
qemu_timings = ret[1]
vcpu_timings = ret[2]
+ result = ret[3]
if uri[0:5] == "unix:" and os.path.exists(uri[5:]):
os.remove(uri[5:])
@@ -509,6 +514,7 @@ def run(self, hardware, scenario, result_dir=os.getcwd()):
Timings(self._get_timings(src) + self._get_timings(dst)),
Timings(qemu_timings),
Timings(vcpu_timings),
+ result,
self._binary, self._dst_host, self._kernel,
self._initrd, self._transport, self._sleep)
except Exception as e:
diff --git a/tests/migration-stress/guestperf/report.py b/tests/migration-stress/guestperf/report.py
index 1efd40c868..e135e01be6 100644
--- a/tests/migration-stress/guestperf/report.py
+++ b/tests/migration-stress/guestperf/report.py
@@ -24,6 +24,22 @@
from guestperf.progress import Progress
from guestperf.timings import Timings
+class ReportResult(object):
+
+ def __init__(self, success=False):
+ self._success = success
+
+ def serialize(self):
+ return {
+ "success": self._success,
+ }
+
+ @classmethod
+ def deserialize(cls, data):
+ return cls(
+ data["success"])
+
+
class Report(object):
def __init__(self,
@@ -33,6 +49,7 @@ def __init__(self,
guest_timings,
qemu_timings,
vcpu_timings,
+ result,
binary,
dst_host,
kernel,
@@ -46,6 +63,7 @@ def __init__(self,
self._guest_timings = guest_timings
self._qemu_timings = qemu_timings
self._vcpu_timings = vcpu_timings
+ self._result = result
self._binary = binary
self._dst_host = dst_host
self._kernel = kernel
@@ -61,6 +79,7 @@ def serialize(self):
"guest_timings": self._guest_timings.serialize(),
"qemu_timings": self._qemu_timings.serialize(),
"vcpu_timings": self._vcpu_timings.serialize(),
+ "result": self._result.serialize(),
"binary": self._binary,
"dst_host": self._dst_host,
"kernel": self._kernel,
@@ -78,6 +97,7 @@ def deserialize(cls, data):
Timings.deserialize(data["guest_timings"]),
Timings.deserialize(data["qemu_timings"]),
Timings.deserialize(data["vcpu_timings"]),
+ ReportResult.deserialize(data["result"]),
data["binary"],
data["dst_host"],
data["kernel"],
--
2.27.0
next prev parent reply other threads:[~2025-02-14 10:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-14 10:55 [PATCH v4 RESEND 0/4] Guestperf: miscellaneous refinement and enrichment yong.huang
2025-02-14 10:55 ` [PATCH v4 RESEND 1/4] guestperf: Support deferred migration for multifd yong.huang
2025-02-14 10:55 ` [PATCH v4 RESEND 2/4] guestperf: Nitpick the inconsistent parameters yong.huang
2025-02-14 10:55 ` [PATCH v4 RESEND 3/4] guestperf: Introduce multifd compression option yong.huang
2025-02-14 10:55 ` yong.huang [this message]
2025-02-14 14:26 ` [PATCH v4 RESEND 4/4] guestperf: Add test result data into report Fabiano Rosas
2025-02-14 18:13 ` [PATCH v4 RESEND 0/4] Guestperf: miscellaneous refinement and enrichment Fabiano Rosas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6303400c2983ffe5647f07caa6406f00ceae4581.1739530098.git.yong.huang@smartx.com \
--to=yong.huang@smartx.com \
--cc=berrange@redhat.com \
--cc=farosas@suse.de \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).