mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
guestperf: Add test result data into report
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> Message-ID: <6303400c2983ffe5647f07caa6406f00ceae4581.1739530098.git.yong.huang@smartx.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
parent
45f34156e4
commit
5984870e02
2 changed files with 28 additions and 2 deletions
|
@ -24,7 +24,7 @@ import sys
|
|||
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 @@ class Engine(object):
|
|||
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 @@ class Engine(object):
|
|||
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 @@ class Engine(object):
|
|||
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:
|
||||
|
|
|
@ -24,6 +24,22 @@ from guestperf.scenario import Scenario
|
|||
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 @@ class Report(object):
|
|||
guest_timings,
|
||||
qemu_timings,
|
||||
vcpu_timings,
|
||||
result,
|
||||
binary,
|
||||
dst_host,
|
||||
kernel,
|
||||
|
@ -46,6 +63,7 @@ class Report(object):
|
|||
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 @@ class Report(object):
|
|||
"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 @@ class Report(object):
|
|||
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"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue