I'm curious how my CPU allowance on PythonAnywhere is trending over several days. Is there a way to access this value from a script such that I can setup a Schedule task to take readings once an hour and save them?
PythonAnywhere dev here: There isn't, unfortunately, but that's a great suggestion! I'll add it to our list.
Update
And here is new (2019-09-11) API endpoint:
/api/v0/user/{username}/cpu/
GET Returns information about cpu usage in json format:
{
"daily_cpu_limit_seconds": <int>,
"next_reset_time": <isoformat>,
"daily_cpu_total_usage_seconds": <float>
}
see the blog post with example of usage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With