Skip to content

Commit

Permalink
chore: udpate sample_latency to use FCMetricsMonitor
Browse files Browse the repository at this point in the history
FCMetricsMonitor class relies on `microvm` having a valid
`kernel_file` to set guest kernel dimensions.
sample_latency test restores microvm from snapshot so it
didn't need to have a guest kernel passed while building
microvm object.
Passing guest kernel shouldn't affect the restore test
but it will help FCMetricsMonitor to get the right guest
kernel version so, update `sample_latency` to pass guest
kernel while building the microvm.

Signed-off-by: Sudan Landge <sudanl@amazon.com>
  • Loading branch information
sudanl0 committed Jan 26, 2024
1 parent 6f16d70 commit 49db07b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/integration_tests/performance/test_snapshot_ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,15 @@ def configure_vm(

return vm

def sample_latency(self, microvm_factory, snapshot) -> List[float]:
def sample_latency(
self, microvm_factory, snapshot, guest_kernel_linux_4_14
) -> List[float]:
"""Collects latency samples for the microvm configuration specified by this instance"""
values = []

for _ in range(ITERATIONS):
microvm = microvm_factory.build(
kernel=guest_kernel_linux_4_14,
monitor_memory=False,
)
microvm.spawn()
Expand Down Expand Up @@ -162,6 +165,7 @@ def test_restore_latency(
samples = test_setup.sample_latency(
microvm_factory,
snapshot,
guest_kernel_linux_4_14,
)

for sample in samples:
Expand Down

0 comments on commit 49db07b

Please sign in to comment.