I am new to code so please go easy, but this is what i am having trouble with.
I am trying to add the estimated frame time into my monitor using the Web Service through Pulse.
I cant seem to find the code to get the job details Statistics, (RunningTime, Estimated Time Remaining, Total Task Time, Total Task Startup Time, ETC…)
I have tried the following code but from my guess is this only seems to work with the older deadline 5, We have just updated to Deadline 6.2
Using Deadline 6.2 This usually kicks up an error like this…
Python Error: InvalidOperationException : can not create two instances of DeadlineApplicationManager
at Deadline.Monitor.MonitorManager…ctor()
at Deadline.Scripting.JobUtils.CalculateJobStatistics(Job job, TaskCollection taskCollection) (Python.Runtime.PythonException)
Stack Trace:
Your help would be much appreciated thanks for your time in advanced.
I just made a quick test shim and it ran great. From what you’re seeing, it looks like we might have a bug in the API somewheres. Can you send us the whole script? Note that because the job ids changed between 5.2 and 6.0 there may be some changes with how we grab those IDs.
Here’s the one I cooked up and ran through deadlinecommand:
[code]from Deadline.Scripting import *
from Deadline.Jobs import *
Thanks for your help and sorry for the late replay, being my first post i though it would notify me through email which was not sent or due to the festive period missed.
We are trying to run this through Pulse Web service and get the Average time to print on the webpage.
Below is your code with a few alterations to work with the web service
Going through the web service this code still chucks out the error noted in my last first post.
I am very new to deadline and scripting so sorry if i am missing any basic knowledge of how i should be running it.
The idea is to have a customized monitor webpage i can easily script to give me all the information i need with extra bells and whistles to make my life easier.
I can get most of the other information fine its just any thing under (Job details then Statistics) i cant seem to access through the web service. If there is another way of getting this information then maybe we could give that a go.
Well, I tried your script by creating a file as “[repo]/custom/scripts/WebService/Blah2.py” and it’s working quite nicely… I’m going to try in 6.
I’m assuming you’re running things correctly here. The error you’re seeing is because something in CalculateJobStatistics() is trying to create more than one singleton of DeadlineApplicationManager. That’s the object internally that keeps track of a bunch of different things (database connection, likely the internal cache, etc) and gets plumbed everywhere.
What version of Deadline are you running this on? 6.2.1 or 6.2.0?
Edit: Testied your script on Deadline 6.2.1.50 and things seem alright there as well.
That’s very strange so it points to how we are set up over hear. Is there any logs i can send to you to see why this is happening our end?
Could this be incorrectly installed or configured? If so do you have any ideas on how we could fix this?
Happy to run a re-install of the whole system but if we don’t have to do that it would help massively due to losing all of our current settings and data.
Thanks for your help so far and if you have any suggestions to what would be the best solution please let me know there must be an easy fix.
Would you have some time this week to look at this one on one? I’m in Winnipeg (Central standard time, GMT-6), if you’re in the UK, is there some time in the afternoon after 3:00pm that would work for you?