[Deadline Scripting] - Job stats

Discussion and Support of Deadline, the Render Management System
Berkyjay
Posts: 531
Joined: Mon Jul 29, 2013 3:14 pm

[Deadline Scripting] - Job stats

Postby Berkyjay » Wed May 17, 2017 3:37 pm

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

Code: Select all

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:

Code: Select all

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


Then I want to run that list through :

Code: Select all

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:

https://github.com/ThinkboxSoftware/Dea ... obStats.py

Thanks!
James Berkheimer
Technical Director
Viscira

eamsler
Posts: 1827
Joined: Thu Dec 16, 2010 1:02 pm
Location: Winnipeg, MB, Canada

Re: [Deadline Scripting] - Job stats

Postby eamsler » Thu May 18, 2017 2:24 pm

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.
Edwin Amsler
Head of Support
Thinkbox Software Inc
+1-866-419-0283 ext 804

Winnipeg

Berkyjay
Posts: 531
Joined: Mon Jul 29, 2013 3:14 pm

Re: [Deadline Scripting] - Job stats

Postby Berkyjay » Thu May 18, 2017 5:53 pm

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.
James Berkheimer
Technical Director
Viscira

eamsler
Posts: 1827
Joined: Thu Dec 16, 2010 1:02 pm
Location: Winnipeg, MB, Canada

Re: [Deadline Scripting] - Job stats

Postby eamsler » Mon May 22, 2017 12:09 pm

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.
Edwin Amsler
Head of Support
Thinkbox Software Inc
+1-866-419-0283 ext 804

Winnipeg

Berkyjay
Posts: 531
Joined: Mon Jul 29, 2013 3:14 pm

Re: [Deadline Scripting] - Job stats

Postby Berkyjay » Mon May 22, 2017 6:17 pm

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. :)
James Berkheimer
Technical Director
Viscira

eamsler
Posts: 1827
Joined: Thu Dec 16, 2010 1:02 pm
Location: Winnipeg, MB, Canada

Re: [Deadline Scripting] - Job stats

Postby eamsler » Tue May 23, 2017 10:05 am

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.
Edwin Amsler
Head of Support
Thinkbox Software Inc
+1-866-419-0283 ext 804

Winnipeg

Berkyjay
Posts: 531
Joined: Mon Jul 29, 2013 3:14 pm

Re: [Deadline Scripting] - Job stats

Postby Berkyjay » Tue May 23, 2017 12:43 pm

That's great! Thanks Edwin.
James Berkheimer
Technical Director
Viscira


Return to “Thinkbox Software - Deadline”

Who is online

Users browsing this forum: No registered users and 2 guests