Forums

Query CPU quota usage from script

My program needs to be able to access how much of my CPU quota I have used. For instance, if I had used 10% (10.00 seconds) of my CPU quota, I'd like to be able to get the percent of CPU I have used (10%).

I'm running python 3.7. A simple way to do it would be appreciated.

Anybody?

Unfortunately, there is no API to get it yet.

If you could make that a project for you guys at pythonanywhere, it would be appreciated.

Thanks!

Sure, it's on the list.

Thanks!

What priority level is it on now? Just out of interest.

We don't give things priority levels. It's on the list of things to do.

Wow, that was quick. How long do you think it will be until it is done?

I repeat, how long until this API is done?

We don't know and we do not give estimates for when we will get to something.

In the next six months?

It depends on if we select it as a feature for us to implement or not. We may choose to implement other features first.

I also want this feature

Thanks for letting us know! I've added an upvote.

Here it is:

/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 new blog post.

Ok thanks fjl!