AWS Thinkbox Discussion Forums

[Deadline Scripting] - Job stats

I’m trying to get the average render time of certain slaves on a job. I’m using this code:

jobIds = MonitorUtils.GetSelectedJobIds() for jobId in jobIds: slaves = RepositoryUtils.GetSlavesRenderingJob(jobId) job = RepositoryUtils.GetJob(jobId, True) tasks = RepositoryUtils.GetJobTasks(job, True)

Then I am am looping through tasks the tasks and filtering out by slave name:

filteredTaskTimes = [] for t in tasks: if "Render53" in t.SlaveName: filteredTaskTimes.append(t.TaskTime)

Then I want to run that list through :

stats = JobUtils.CalculateJobStatistics(job, filteredTaskTimes)

The problem is that CalculateJobStatistics looks like it takes a TaskCollection object and not a straight list. So I’m kind of stuck moving forward.

I’m sourcing this script as reference:

github.com/ThinkboxSoftware/Dea … obStats.py

Thanks!

Huh. Yeah, I don’t think you can actually do that to be honest… I think you may need to implement the aggregation yourself here. I’ll ask around just be sure.

Thanks Edwin. It would be really helpful. We’re trying to evaluate some new render blades we got in and I’m trying to get a bit more granular render stats.

So, I dug into the code and also asked around. We absolutely don’t support filtering anything going into that function right now, so you’ll have to walk over the tasks yourself.

Really, the code doesn’t seem to do much except calculate the wasted and total times across those tasks.

Hmm, well part of the problem I had was that CalculateJobStatistics() method takes a custom Deadline object and not a straight up Python list object (at least that’s my best guess). I was hoping that there was a way to turn my filtered list into that Deadline list object. I’m guess there won’t be, but it doesn’t hurt to ask. :slight_smile:

I want there to be one. The head of core is onboard too, I just forgot to make a dev issue after my conversation with him. I’ll go do that now.

Update: The plan I suggested was to make a generic version of JobEntry and allow you to do exactly what you suggested: pass arbitrary iterable collections over to it to calculate. I don’t know how expensive the operation is going to be (do we need to pull job reports for Tasks for example?), but I’m hoping it’ll be clean to implement.

That’s great! Thanks Edwin.

Privacy | Site terms | Cookie preferences