Announcement

Collapse
No announcement yet.

How to -dynamically- get rendertimes from backburner?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to -dynamically- get rendertimes from backburner?

    We would like to control the time spent on each project using the information contained in the backburner monitor in an automatic way. So far, we´ve managed to get reports from each job in monitor queue and use them with calc in openoffice, getting the final time spent on a particular shot. Next step would be to establish a workflow in which each finished job time is added to the final project time dynamically, with no -or little- user intervention, so that it can be monitored whenever you want.

    It would be useful for both internal control, and render charging.
    Any ideas for that? Thanks!
    My Youtube VFX Channel - http://www.youtube.com/panthon
    Sonata in motion - My first VFX short film made with VRAY. http://vimeo.com/1645673
    Sunset Day - My upcoming VFX short: http://www.vimeo.com/2578420

  • #2
    you can get the time spent rendering a netrender job using maxscript

    <job>.timeStarted
    Returns the time at which the job was started as a string. Returns undefined if job hasn’t started. Read-only.

    <job>.timeFinished
    Returns the time at which the job was finished as a sting. Returns undefined if job hasn’t finished. Read-only.
    you can look it up in the maxscript reference
    you probably need a callback that triggers when a job has changed
    <netManager>.setCallback #progress | #message | #update | #managerdown | #queuecontrol | #querycontrol <somefunction>

    #update : Called when something has changed, like a job started or finished. Let's you know when you need to make GetUpdate calls, or other refreshing
    when the callback triggers, you get the finished jobs and try to get the start/finish time for them

    <netManager>.getjobs
    filter:#complete: Returns an array of all completed jobs. Returns an empty array #() if no jobs are complete.
    the reference says that you should avoid calling .getjobs too often since its network heavy
    then you have to calculate the time spent for the job and do something with it
    you probably have to remember which jobs have already been counted and exclude those from further time calculations

    mike

    Comment


    • #3
      Just a tool that would export the stats to a spreadsheet or something like that would be great. Looked for it, could not find it..
      Alain Blanchette
      www.pixistudio.com

      Comment


      • #4
        goto scriptspot.com and look for "i know what you did last summer"

        ---------------------------------------------------
        MSN addresses are not for newbies or warez users to contact the pros and bug them with
        stupid questions the forum can answer.

        Comment


        • #5
          Mike.edel: Thanks for your reply, we´ll look into that. I have no skills at all when it comes to use maxscript, but hopefully someone in the studio will try.

          Thablanch: There´s the option "report" which will give u this info in formated text, from the monitor queue of backburner.

          Da_elf: That script is quite outdated -last version i´ve found is for max 5- and doesn´t seem to do what we need: track the render time per project. Thanks anyway
          My Youtube VFX Channel - http://www.youtube.com/panthon
          Sonata in motion - My first VFX short film made with VRAY. http://vimeo.com/1645673
          Sunset Day - My upcoming VFX short: http://www.vimeo.com/2578420

          Comment


          • #6
            i did some tests and ran into some ugly problems
            right now i am able to get the start/complete times
            unfortunately they come out like this:

            "Sat 03/09/2006 21h:17m:52.278s"
            "Sat 03/09/2006 21h:18m:00.280s"

            difficult to parse this string into something usable

            my code so far:

            Code:
            --NetrenderLog
            --experimental version 0.1
            --Mike
            --logs the time spent rendering a netrender job
            
            --location of the manager &#40;netmask&#41; - adjust to your settings
            global manNetmask = "255.255.255.0"
            
            --get an instance of the netmanager
            global myManager=NetRender.GetManager&#40;&#41;
            
            --connect to the Manager in the subnet set above
            isConnected=myManager.connect #automatic manNetmask
            
            --define function to get the job timings
            --fn testFn lWert = &#40;print &#40;lWert&#41;&#41;
            
            fn getJobTimings=
            	&#40;
            	lManager = myManager
            	--get number of complete jobs
            	lJobs = &#40;lManager.getJobs filter&#58;#complete&#41;
            	lNumJobs = lJobs.count
            	--if there are any complete jobs, get their timings
            	if &#40;lNumJobs > 0&#41; then for i = 1 to lNumJobs do
            		&#40;
            		--print &#40;lJobs&#91;i&#93;.GetLog&#40;&#41;&#41;
            		print &#40;lJobs&#91;i&#93;.name&#41;
            		print &#40;lJobs&#91;i&#93;.timeStarted&#41;
            		print &#40;lJobs&#91;i&#93;.timeFinished&#41;
            		
            		&#41;
            	--or print error message
            	else print "No complete Jobs in Queue"
            	&#41;
            	
            --if the connection worked, set up a callback that triggers when a job changes &#40;submit/start/finish&#41;
            if &#40;isConnected&#41; then
            	&#40;
            	myManager.setCallback #update getJobTimings
            	--getJobTimings&#40;myManager&#41;
            	getJobTimings&#40;&#41;
            	&#41;
            else print "no connection to the manager possible"
            
            --disconnect from the manager
            --myManager.disconnect
            run once before submitting jobs and watch the listener
            if the parsing problem could be solved one could write the times to a table together with the job's name, handle (unique id to prevent duplicates) and other information

            the other thing would be to use the job's log (job.getLog)
            the first line should look like
            2006/03/09 21:17:52 INF Job Started
            while the last line should be
            2006/03/09 21:18:00 INF Job Complete
            which is easier to parse into date/time values

            everything between those would be progress messages that could be ignored

            maybe i'll try tomorrow

            mike

            Comment


            • #7
              Hey mike.edel, thanks for spending time on this subject!

              For us, it would be more useful to take into account the individual frame rendertimes, because start to stop time may be not accurate. Sometimes some jobs get interrupted by a higher priority job, so they can stop for days, and then go on. Unless backburner is aware of that, the time spent rendering that job would be incorrect. Our approach implies getting all the frames render times, sum them up and provide us with a total time result. Another way to do that would be multiply the average frame time by the number of frames.

              Maybe could be good to have a maxscript which took the backburner report or log, look in the frametime data column, and get a result of the total time, doing this for all the logs related to a particular project, which should be conveniently named in the render queue. Then, at the end, we would have a total render time per project, which is what we need.

              Thanks for your patience!
              My Youtube VFX Channel - http://www.youtube.com/panthon
              Sonata in motion - My first VFX short film made with VRAY. http://vimeo.com/1645673
              Sunset Day - My upcoming VFX short: http://www.vimeo.com/2578420

              Comment


              • #8
                oh, i see

                hmmn
                don't know if it's possible to get the frametimes via maxscript

                at least in the report you can get the time per frame if you set "Notify Progress every Nth pass" to 1
                but this will probably be very network-heavy

                in that case the time also shows up in the job's log:

                "2006/03/10 12:55:59 INF Job Started
                2006/03/10 12:56:44 PRG TS:00000000 TM:00045546 SR:mikes-computer
                2006/03/10 12:57:19 PRG TS:00000001 TM:00034790 SR:mikes-computer
                2006/03/10 12:57:56 PRG TS:00000002 TM:00037173 SR:mikes-computer
                2006/03/10 12:58:33 PRG TS:00000003 TM:00036753 SR:mikes-computer
                "
                TS: frame number
                TM: is the time per for the frame
                should be possible to parse this

                btw: 00034790 is 34.790 seconds
                don't know yet what these values would look like for minutes or hours of rendertime per frame

                Comment


                • #9
                  Hi,
                  yes, you can get frametimes via maxscript with:
                  Code:
                  j = m.getjobs&#40;&#41;
                  fr = j&#91;job_number&#93;.GetFrameInfo frame_number
                  frame_time = fr.elapsedtime
                  The obtained frame time is in miliseconds, so I do something like this to get more readable values:
                  Code:
                  h = &#40;total_time/3600000&#41; as integer
                  m = &#40;&#40;total_time - h*3600000&#41;/60000&#41; as integer
                  s = &#40;&#40;total_time - h*3600000 - m*60000&#41;&#41;/1000 as integer
                  format "Total job time&#58; %s &#40;%h %m %s&#41;\n" &#40;total_time/1000&#41; h m s
                  I managed to do a little script that gets total time of a certain job, now I just need a little time to make a nice frontend so those lazy users can get the info with a couple of clicks

                  Thanks for the info

                  Comment

                  Working...
                  X