summary refs log tree commit diff stats
path: root/tests/migration-stress/guestperf/progress.py
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2024-12-12 18:45:09 -0500
committerStefan Hajnoczi <stefanha@redhat.com>2024-12-12 18:45:09 -0500
commitbdce9bc9179bd7b6f4e12c759dd3cd6794e26a6b (patch)
treeac50a528b74309d205ce97bf770d7e8b1b0fd5c4 /tests/migration-stress/guestperf/progress.py
parent1eec82cc06cd68b6ffaf13ba8337fac0080c7bce (diff)
parentde8bc62cc4871fa97d1891ebb96e782b0c75b56a (diff)
downloadfocaccia-qemu-bdce9bc9179bd7b6f4e12c759dd3cd6794e26a6b.tar.gz
focaccia-qemu-bdce9bc9179bd7b6f4e12c759dd3cd6794e26a6b.zip
Merge tag 'qtest-20241212-pull-request' of https://gitlab.com/farosas/qemu into staging
Qtest pull request

- TIMEOUT_MULTIPLIER setting to allow tests to take longer when asan is enabled
- New qtest_system_reset() wrapper to properly wait for a system reset
- Split of migration-test.c into multiple files under qtest/migration/

# -----BEGIN PGP SIGNATURE-----
#
# iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmda+84QHGZhcm9zYXNA
# c3VzZS5kZQAKCRDHmNx0G+wxnXWZEACcxW/P9EiLxIeCf4ke7/qq+8HSOOLdQrEa
# hP5ZCzLlY0K8KQ9fhTGvc6UgRBsScXcLuj4eoR8Gke9e4tID39XVdkion/x6OCiv
# grC2Ll9/BNrWtR8DiXs3krsU1CXhav6qcT56bMiXV3Qo+KsTmB7RkpXpbkZLZxkn
# P2aqZlYFS0zZ3PZQceCasQEzB6Dls7o1wNXvgSJXr2E4IuIEcbyWtQpr5DfctnfN
# STbqGTgMXADyjlqh3CWwSLsZQvIVoN9+3twOrZn4j0D+fyEsTjKsZPlUpRtr72ap
# FVT+zVIUfxieBlDTsRSwcieD1ePFUUjl7ikQFwypGs33TI9VDTsB88IG7h0/080o
# 7dYbSMSG0pGEq9QIB8jkV26OZi3y00L/zmLMNDsN6nxKN4mSySlfVD/B/Jb70Smy
# lwbLklnr921kqsF89Bsq8YRyg8bbGXtx2ifGROgqF+JtrxRW0ElF9K/h4HQtPjuD
# nZJ4rtrDIv1iMTLJwbNu39fhxvuQowdBYTrbPMgw+xIv++LodqYJSDxbEX+FaDqI
# LMf772jiAgesl7qe1d9TJizhvonyi9PIdcUILg0SH0H1KvoSjpS3mlGgvo8zgvh+
# zvhhzkFGDIHmlCvOaIYyCpadJ5SMMS627q/Q13X3DHjUTkpPUhxGgc9oO7T39+iA
# 4dOLDRjUcg==
# =H6xv
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 12 Dec 2024 10:05:50 EST
# gpg:                using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D
# gpg:                issuer "farosas@suse.de"
# gpg: Good signature from "Fabiano Rosas <farosas@suse.de>" [unknown]
# gpg:                 aka "Fabiano Almeida Rosas <fabiano.rosas@suse.com>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: AA1B 48B0 A223 26A5 A4C3  64CF C798 DC74 1BEC 319D

* tag 'qtest-20241212-pull-request' of https://gitlab.com/farosas/qemu: (22 commits)
  tests/qtest/migration: Split validation tests + misc
  tests/qtest/migration-test: Fix and enable test_ignore_shared
  tests/qtest/migration: Split CPR tests
  tests/qtest/migration: Split precopy tests
  tests/qtest/migration: Split file tests
  tests/qtest/migration: Split postcopy tests
  tests/qtest/migration: Split compression tests from migration-test.c
  tests/qtest/migration: Split TLS tests from migration-test.c
  tests/qtest/migration: Move common test code
  tests/qtest/migration: Isolate test initialization
  tests/qtest/migration: Move kvm_dirty_ring_supported to utils
  tests/qtest/migration: Move ufd_version_check to utils
  tests/qtest/migration: Rename migration-helpers.c
  tests/qtest/migration: Move qmp helpers to a separate file
  tests/qtest/migration: Move bootfile code to its own file
  tests/migration: Disambiguate guestperf vs. a-b
  tests/qtest/migration: Stop calling everything "test"
  tests/qtest/migration: Standardize hook names
  tests/qtest: Use qtest_system_reset_nowait() where appropriate
  tests/qtest: Use qtest_system_reset() instead of open-coded versions
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'tests/migration-stress/guestperf/progress.py')
-rw-r--r--tests/migration-stress/guestperf/progress.py129
1 files changed, 129 insertions, 0 deletions
diff --git a/tests/migration-stress/guestperf/progress.py b/tests/migration-stress/guestperf/progress.py
new file mode 100644
index 0000000000..d490584217
--- /dev/null
+++ b/tests/migration-stress/guestperf/progress.py
@@ -0,0 +1,129 @@
+#
+# Migration test migration operation progress
+#
+# Copyright (c) 2016 Red Hat, Inc.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, see <http://www.gnu.org/licenses/>.
+#
+
+
+class ProgressStats(object):
+
+    def __init__(self,
+                 transferred_bytes,
+                 remaining_bytes,
+                 total_bytes,
+                 duplicate_pages,
+                 skipped_pages,
+                 normal_pages,
+                 normal_bytes,
+                 dirty_rate_pps,
+                 transfer_rate_mbs,
+                 iterations):
+        self._transferred_bytes = transferred_bytes
+        self._remaining_bytes = remaining_bytes
+        self._total_bytes = total_bytes
+        self._duplicate_pages = duplicate_pages
+        self._skipped_pages = skipped_pages
+        self._normal_pages = normal_pages
+        self._normal_bytes = normal_bytes
+        self._dirty_rate_pps = dirty_rate_pps
+        self._transfer_rate_mbs = transfer_rate_mbs
+        self._iterations = iterations
+
+    def serialize(self):
+        return {
+            "transferred_bytes": self._transferred_bytes,
+            "remaining_bytes": self._remaining_bytes,
+            "total_bytes": self._total_bytes,
+            "duplicate_pages": self._duplicate_pages,
+            "skipped_pages": self._skipped_pages,
+            "normal_pages": self._normal_pages,
+            "normal_bytes": self._normal_bytes,
+            "dirty_rate_pps": self._dirty_rate_pps,
+            "transfer_rate_mbs": self._transfer_rate_mbs,
+            "iterations": self._iterations,
+        }
+
+    @classmethod
+    def deserialize(cls, data):
+        return cls(
+            data["transferred_bytes"],
+            data["remaining_bytes"],
+            data["total_bytes"],
+            data["duplicate_pages"],
+            data["skipped_pages"],
+            data["normal_pages"],
+            data["normal_bytes"],
+            data["dirty_rate_pps"],
+            data["transfer_rate_mbs"],
+            data["iterations"])
+
+
+class Progress(object):
+
+    def __init__(self,
+                 status,
+                 ram,
+                 now,
+                 duration,
+                 downtime,
+                 downtime_expected,
+                 setup_time,
+                 throttle_pcent,
+                 dirty_limit_throttle_time_per_round,
+                 dirty_limit_ring_full_time):
+
+        self._status = status
+        self._ram = ram
+        self._now = now
+        self._duration = duration
+        self._downtime = downtime
+        self._downtime_expected = downtime_expected
+        self._setup_time = setup_time
+        self._throttle_pcent = throttle_pcent
+        self._dirty_limit_throttle_time_per_round = \
+            dirty_limit_throttle_time_per_round
+        self._dirty_limit_ring_full_time = \
+            dirty_limit_ring_full_time
+
+    def serialize(self):
+        return {
+            "status": self._status,
+            "ram": self._ram.serialize(),
+            "now": self._now,
+            "duration": self._duration,
+            "downtime": self._downtime,
+            "downtime_expected": self._downtime_expected,
+            "setup_time": self._setup_time,
+            "throttle_pcent": self._throttle_pcent,
+            "dirty_limit_throttle_time_per_round":
+                self._dirty_limit_throttle_time_per_round,
+            "dirty_limit_ring_full_time":
+                self._dirty_limit_ring_full_time,
+        }
+
+    @classmethod
+    def deserialize(cls, data):
+        return cls(
+            data["status"],
+            ProgressStats.deserialize(data["ram"]),
+            data["now"],
+            data["duration"],
+            data["downtime"],
+            data["downtime_expected"],
+            data["setup_time"],
+            data["throttle_pcent"],
+            data["dirty_limit_throttle_time_per_round"],
+            data["dirty_limit_ring_full_time"])