I am working in python, I had a python script that reads the data from text file and saves in to database.
I got some requirement like to find below 3 points
1. Total execution time taken by the script for running
2. CPU utilization (For process performing by the python script)
3. Memory usage (For process performing by the python script)
For the first point i.e., i am finding the total execution time taken by the script to process(read the text file and saving in to database) as below
python -m cProfile script_that_runs_process.py
But i am unable to understand how to find the another two points ? I googled and found some python module psutil , but i am confused and really don't know on how to implement the another two points with this....
Can anyone please let me know on how to find CPU Memory utilization
, Memory Usage
when a python script is runned(That performs certain task) ?