Skip to content

Commit

Permalink
testing: log the CPU serial number in the router benchmark.
Browse files Browse the repository at this point in the history
This is done as an attempt at detecting live migration.
  • Loading branch information
jiceatscion committed Dec 18, 2023
1 parent 71a44df commit e963753
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions acceptance/router_benchmark/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from collections import namedtuple
from plumbum import cli
from plumbum.cmd import docker, whoami, lscpu
from plumbum.cmd import docker, whoami, lscpu, grep
from plumbum import cmd

from acceptance.common import base
Expand Down Expand Up @@ -417,7 +417,6 @@ def run_test_case(self, case: str, mapArgs: list[str]) -> (int, int):

output = self.exec_br_load(case, mapArgs, 10000000)
for line in output.splitlines():
print(line)
if line.startswith("metricsBegin"):
_, beg, _, end = line.split()

Expand Down Expand Up @@ -519,6 +518,10 @@ def _run(self):
# gets much lower performance.
self.exec_br_load(list(TEST_CASES)[0], mapArgs, 3000000)

# Record the CPU serial in an attempt at detecting live migrations.
logger.info("CPU serial BEFORE: "
f'{(cmd.sudo["-A", "dmidecode", "-t", "processor"] | grep["ID:"])().strip()}')

# At long last, run the tests
rateMap = {}
droppageMap = {}
Expand All @@ -527,6 +530,9 @@ def _run(self):
rateMap[testCase] = processed
droppageMap[testCase] = dropped

logger.info("CPU serial AFTER: "
f'{(cmd.sudo["-A", "dmidecode", "-t", "processor"] | grep["ID:"])().strip()}')

self.log_core_counts()

# Log and check the performance...
Expand Down

0 comments on commit e963753

Please sign in to comment.