Use Python API to get slave idle time?

I’m looking for a way to get idle time for Deadline 8 slaves using the Python API. I can successfully call Slaves.GetSlaveInfo() and see that a slave is in ‘Stat 2’ (which appears to be Idle), and get the last status update time (StatDate) – but I can’t seem to find a way to get the actual idle time.

Thanks in advance.

Hi,

Are you referring to obtaining the “Idle Time” of a Slave as seen via our Farm Reports system -> “Active Slave Stats” in Monitor? If so, we haven’t yet exposed any of the other statistical objects to our API; only the most popular one - “job” stats:
docs.thinkboxsoftware.com/produc … entry.html

which is only available via our Scripting API currently and not via the Python Standalone API wrapper around our RESTful API.

This might make for a good feature request though if it is indeed what your after here?

Yeah, what I’m looking for is the data underlying the “status” column in the active slaves pane of the Deadline Monitor.I’m particularly interested in seeing how long specific slaves have been idle for.

If this is available in the Scripting API, that would probably work for what I’m trying to do right now. Looking at the scripting reference, is the Deadline.Scripting.RepositoryUtils class what I should be using? Will the getSlaveInfo(s) methods there return a “time in state” value?

How would I go about submitting a feature request for this, since I’m pretty sure we’re talking about the same thing?

Sorry it took so long for me to reply to this, your post was on my radar but I seemed to have never actually replied :frowning:

We don’t actually store the amount of time since the state last changed, we compute this dynamically by doing:

(Current Repository Date/Time) - (SlaveInfo.StatDate) = State (e.g. Idle) time

So it should be just a matter of doing that as well. Unfortunately, it doesn’t seem like we currently have a function to get the current Repository Date/Time via our Standalone Python/RESTful API (via our regular scripting API you can use the RepositoryUtils.GetRepositoryDateTime function). You should be able to estimate based on the current machine’s clock time though; if everything is synched to a time server it should work out to be basically the same (as long as you’re accounting for the current Time Zones, which should be serialized as part of the StatDate).