Пример #1
0
        public void MonitorRequestQueue()
        {
            Log.Info(this, "Scaling Manager started");
            while (Thread.CurrentThread.IsAlive)
            {
                LbGetRequestQueueResponse response = null;
                try
                {
                    Log.Info(this, "Checking request queue status...");
                    LbGetRequestQueueRequest request = new LbGetRequestQueueRequest(Settings.Credentials);
                    response = EndPoints.GetLbApplicationGridService().GetRequestQueue(request);
                }
                catch (Exception e)
                {
                    Log.Error(this, e);
                }

                try
                {
                    if (response != null)
                        ScaleApplications(response.RequestQueue);
                    Thread.Sleep(monitoringInterval);
                }
                catch (Exception e)
                {
                    Log.Error(this, e);
                }
            }
            Log.Info(this, "Scaling Manager stopped");
        }
Пример #2
0
        public LbGetRequestQueueResponse GetRequestQueue(LbGetRequestQueueRequest request)
        {
            try
            {
                Log.Debug(this, "GetRequestQueue()");

                Authenticate(request);
                LbGetRequestQueueResponse response = new LbGetRequestQueueResponse();
                if (request.RequestType == RequestType.RequestQueue)
                    response.RequestQueue = Database.GetInstance().RequestQueue;
                else if (request.RequestType == RequestType.AllRequests)
                    response.RequestQueue = Database.GetInstance().RequestQueueHistory;
                return response;
            }
            catch (Exception e)
            {
                Log.Error(this, e);
                throw e;
            }
        }