Skip to content

Commit 1634197

Browse files
committed
test: run snapshot creation performance test with both full and diff
Diff snapshots create sparse files, so they should be a lot faster than full snapshots. Signed-off-by: Patrick Roy <[email protected]>
1 parent e2b2944 commit 1634197

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

tests/integration_tests/performance/test_snapshot.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pytest
1212

1313
import host_tools.drive as drive_tools
14-
from framework.microvm import HugePagesConfig, Microvm
14+
from framework.microvm import HugePagesConfig, Microvm, SnapshotType
1515

1616
USEC_IN_MSEC = 1000
1717
NS_IN_MSEC = 1_000_000
@@ -257,21 +257,30 @@ def test_snapshot_create_latency(
257257
guest_kernel_linux_5_10,
258258
rootfs,
259259
metrics,
260+
snapshot_type,
260261
):
261262
"""Measure the latency of creating a Full snapshot"""
262263

263264
vm = microvm_factory.build(guest_kernel_linux_5_10, rootfs, monitor_memory=False)
264265
vm.spawn()
265-
vm.basic_config(vcpu_count=2, mem_size_mib=512)
266+
vm.basic_config(
267+
vcpu_count=2,
268+
mem_size_mib=512,
269+
track_dirty_pages=snapshot_type == SnapshotType.DIFF,
270+
)
266271
vm.start()
267272
vm.pin_threads(0)
268273

269274
metrics.set_dimensions(
270-
{**vm.dimensions, "performance_test": "test_snapshot_create_latency"}
275+
{
276+
**vm.dimensions,
277+
"performance_test": "test_snapshot_create_latency",
278+
"snapshot_type": snapshot_type.value,
279+
}
271280
)
272281

273282
for _ in range(ITERATIONS):
274-
vm.snapshot_full()
283+
vm.make_snapshot(snapshot_type)
275284
fc_metrics = vm.flush_metrics()
276285

277286
value = fc_metrics["latencies_us"]["full_create_snapshot"] / USEC_IN_MSEC

0 commit comments

Comments
 (0)