문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top