Skip to content

Commit

Permalink
router: Make the benchmark test log the number of cores.
Browse files Browse the repository at this point in the history
Just so that I can easily see what the CI environment is like.
  • Loading branch information
jiceatscion committed Nov 8, 2023
1 parent d40ff53 commit 7c521c9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions acceptance/router_benchmark/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7c521c9

Please sign in to comment.