Run memory monitoring inside AP tests with prmon
I use prmon
from lb-conda DPA/analysis-productions
Tried to follow asyncio
-ness as in the rest of the script.
The task is started after launching the test process, assuming that the gaudi process is a child process of the dirac command used to launch the test, prmon
should track everything.
The monitor task should complete by itself once the process being monitored quits, but there is some stuff added to attempt to clean up if not. Two output files are produced that are uploaded to S3: prmon.json
(summary stats) and prmon.txt
(evolution of various metrics versus time). These can be used to produce bokeh plots and display on LbAPWeb.
Example prmon.txt
Time wtime pss rss swap vmem rchar read_bytes wchar write_bytes rx_bytes rx_packets tx_bytes tx_packets stime utime nprocs nthreads
1661454549 24 103 612 0 108064 2012 0 0 0 10208 114 1295 8 0 0 1 1
1661454580 55 103 612 0 108064 2012 0 0 0 2484932 8221 7763101 5861 0 0 1 1
1661454611 86 103 612 0 108064 2012 0 0 0 3376696 14322 8557961 7767 0 0 1 1
1661454642 117 103 612 0 108064 2012 0 0 0 4884905 21695 10314346 10806 0 0 1 1
prmon
is configured to sample the memory stats from the tracked process every 30 seconds (that's the default)
Not tested yet
Relates to https://gitlab.cern.ch/lhcb-dpa/project/-/issues/76 and #24 (closed)