diff --git a/acceptance/router_benchmark/test.py b/acceptance/router_benchmark/test.py index dbea3285f8..dec5f05e75 100755 --- a/acceptance/router_benchmark/test.py +++ b/acceptance/router_benchmark/test.py @@ -63,6 +63,27 @@ def _run(self): # Give some time for the topology to start. self.await_connectivity() + # Fetch and log the number of cores used by Go. This may inform performance + # modeling later. + promQuery = urlencode({ + 'query': 'avg by (job) (go_sched_maxprocs_threads{job="BR"})' + }) + + conn = HTTPConnection("localhost:9090") + conn.request('GET', f'/api/v1/query?{promQuery}') + resp = conn.getresponse() + if resp.status != 200: + raise RuntimeError(f'Unexpected response: {resp.status} {resp.reason}') + + pld = json.loads(resp.read().decode('utf-8')) + results = pld['data']['result'] + numCores = 0 + for result in results: + _, val = result['value'] + numCores = int(float(val)) + + logger.info(f'Router Cores: {numCores}') + # Start as-transiting load. With the router_bm topology # The subset noncore#nonlocalcore gives us outgoing traffic at each