Ejemplo n.º 1
0
 public Breaker(Int64 sendImageInterval, Int64 renderTime, double requiredSpp,
                LuxEngine engine, RenderLog log)
 {
     m_totalRenderTime   = renderTime * 1000; //time in millisec
     m_requiredSpp       = requiredSpp;
     m_sendImageInterval = sendImageInterval * 1000;
     m_timeToNextUpdate  = m_sendImageInterval;
     m_engine            = engine;
     m_log = log;
     m_log.Info("Required SPP: " + m_requiredSpp);
     m_currentSpp = 0;
     m_log.Info("Breaker initialized");
 }
Ejemplo n.º 2
0
        InstanceManager(RenderLog log)
        {
            m_log = log;
            m_log.Info("INSTANCE_MANAGER: Initializing instance manager");
            m_requestLock = new Object();
            //timer initialization
            m_instancesTimer          = new System.Timers.Timer(DocConstants.WAIT_AFTER_SCALE_REQUEST);
            m_instancesTimer.Elapsed += new ElapsedEventHandler(scaleFinished);
            m_instancesTimer.Enabled  = false;
            m_timer          = new System.Timers.Timer(RenderUtils.DocConstants.INSTANCES_REMOVING_INTERVAL);
            m_timer.Elapsed += new ElapsedEventHandler(timerElapsed);
            m_timer.Enabled  = true;
            if (DocConstants.Get().ConnectionString != DocConstants.DEBUG_CONNECTION_STRING)
            {
                string deploymentInfo = AzureRESTMgmtHelper.GetDeploymentInfo();
                string svcconfig      = AzureRESTMgmtHelper.GetServiceConfig(deploymentInfo);                                 //get azure config XML
                Int32.TryParse(AzureRESTMgmtHelper.GetInstanceCount(svcconfig, DocConstants.WORKER_NAME), out m_workerCount); //get number of
                if (m_workerCount <= 0)
                {
                    m_log.Warning("INSTANCE_MANAGER: Azure returned worker instance number as: " + m_workerCount);
                    m_workerCount = 1;
                }
                else
                {
                    m_log.Info("INSTANCE_MANAGER: initial worker count is: " + m_workerCount);
                }
                Int32.TryParse(AzureRESTMgmtHelper.GetInstanceCount(svcconfig, DocConstants.MERGER_NAME), out m_mergerCount);
                if (m_mergerCount <= 0)
                {
                    m_log.Warning("INSTANCE_MANAGER: Azure returned merger instance number as: " + m_workerCount);
                    m_mergerCount = 1;
                }
                else
                {
                    m_log.Info("INSTANCE_MANAGER: initial merger count is: " + m_mergerCount);
                }

                m_workerFreeCount = m_workerCount;
                m_mergerFreeCount = m_mergerCount;
            }
            m_scalePerforming = false;
        }