Uses psutil to observe/log processes during a certain time
pip install procobserver
fromprocobserverimportobserve_procsdf=observe_procs(
executables=("Vpn.exe",), # list or tuple of exe files (not the whole path!)pids=(5800, 18166), # list or tuple of pids pickle_output_path="f:\\picklefileobj.pkl", # If None, nothing will be saved to your HDD sleeptime=0.2, # sleep between each scan timeout=30, # If timeout is None, you have to press ctrl+c
)
# Press ctrl+c to stop the observationOut[2]: '\n^CStoppingobservation ...
dfOut[3]:
0num_handles ... aa_localtime0484 ... 1.678241e+091604 ... 1.678241e+092870 ... 1.678241e+0931336 ... 1.678241e+094419 ... 1.678241e+095484 ... 1.678241e+096604 ... 1.678241e+097870 ... 1.678241e+0981336 ... 1.678241e+099419 ... 1.678241e+09
[10rowsx28columns]
The Tidelift Subscription provides access to a continuously curated stream of human-researched and maintainer-verified data on open source packages and their licenses, releases, vulnerabilities, and development practices.