Hi all
I am using Deadline 6.1 and am having trouble finding where the estimated time for the job is. I also need to know how to access this information with python as I am having some trouble finding this on the scripting area of the site.
If anyone could help me with this i would be extremely grateful.
Code below:
from System.IO import *
from System.Text import *
from Deadline.Scripting import *
def main( dlArgs, qsArgs ):
returnVal = “”
returnVal = Deadline.Statistics.JobEntry.AverageFrameRenderTime ##this is the code i am having trouble with
return str(returnVal)
Hi,
Here’s a simple example script which can be dropped into your “[deadline_repo_path]/custom/scripts/general” directory. To calculate job stats, we first need to grab the job, it’s tasks and then we can calculate all the job’s stats and return a job stats object. Here’s how it works:
[code]from Deadline.Scripting import *
from Deadline.Jobs import *
def main(*args):
# Grab all jobs
alljobs = RepositoryUtils.GetJobs( True )
# Filter down to only look at "Active" jobs
jobs=[]
for job in alljobs:
if job.JobStatus == "Active":
jobs.append( job )
for job in jobs:
print "JobStatus: %s" % job.JobStatus
jobId = job.JobId
print "JobId: %s" % jobId
jobName = job.JobName
print "JobName: %s" % jobName
jobPool = job.JobPool
print "JobPool: %s" % jobPool
jobCompletedChunks = job.CompletedChunks
print "JobCompletedChunks: %s" % jobCompletedChunks
job = RepositoryUtils.GetJob( jobId, True )
tasks = RepositoryUtils.GetJobTasks( job, True )
stats = JobUtils.CalculateJobStatistics( job, tasks )
jobAverageFrameTime = stats.AverageFrameTime
jobAverageRamUsage = stats.AverageRamUsage/1024/1024
print "JobAverageFrameTime: %s" % jobAverageFrameTime
print "JobAverageRamUsage: %s" % jobAverageRamUsage[/code]
Note, I’m doing some extra things here for fun, such as grabs all jobs in the queue, then filter down to only the ACTIVE jobs, printing out some other properties about the job for fun and then calculate the stats object and then query it for a couple of properties - Average Frame Time (what you asked for) & Average Ram Usage, just for fun 
See attached script. Hope this helps!
Mike
JobStatsExample.py.zip (576 Bytes)
Thanks Mike that code was a huge help.
I think it might be worth using the average frame time to work out the estimated time so I will busy for a while 
still getting to grips with deadline and pretty new to Python but hopefully i will get there.
Sure, glad it’s helped.
I just re-read the first line of your original post:
Sorry, I missed answering that part. If you open the “Job Details” panel, select a job and then in the “Job Details” panel, expand the “Statastics” section, you will see various stats such as ETA. The ETA is also shown at the top of the task panel if available/known.