KZiovas
KZiovas

Reputation: 4799

How to measure execution stats of a Python script CPU usage, RAM usage, disk usage etc?

Is there a Python module that you can use to get execution stats for a piece of code or a python app ? For example something like:

get_stats.start() 
#python code 
stats = get_stats.end()

The stats I am interested in are cpu usage, ram usage and execution time

Upvotes: 0

Views: 1311

Answers (1)

KZiovas
KZiovas

Reputation: 4799

So using psutil i made this helper metrics class you can see in this gist

Upvotes: 1

Related Questions