Exemplo n.º 1
0
 private static void CheckComponentControl()
 {
     if (ComponentControl.IsFake())
     {
         throw new Exception("Component control is fake");
     }
 }
        protected override string GetDebugInfo()
        {
            var output = new StringBuilder();

            output.AppendLine("DispatcherWrapper.Uptime = " + DispatcherWrapper.UptimeTimer.Elapsed);
            output.AppendLine("------------");

            if (ComponentControl.IsFake() == false)
            {
                output.AppendLine("Api.EventManager.GetQueueSize(): " + DataSizeHelper.GetSizeText(ComponentControl.Client.EventManager.GetQueueSize()));
                output.AppendLine("Api.WebLogManager.GetQueueSize(): " + DataSizeHelper.GetSizeText(ComponentControl.Client.WebLogManager.GetQueueSize()));
            }
            output.AppendLine("------------");

            output.AppendLine("");
            foreach (var cache in AllCaches.All)
            {
                output.AppendLine("--- " + cache.GetType() + " ---");
                output.AppendLine("Count: " + cache.Count);
                output.AppendLine("Size: " + DataSizeHelper.GetSizeText(cache.GetSize()));
                output.AppendLine("Changed: " + cache.GetChangedCount());
                output.AppendLine("LastSaveChangesDate: " + cache.GetLastSaveChangesDate());
                output.AppendLine("AddCacheCount: " + cache.AddCacheCount);
                output.AppendLine("AddDataBaseCount: " + cache.AddDataBaseCount);
                output.AppendLine("UpdateCacheCount: " + cache.UpdateCacheCount);
                output.AppendLine("UpdateDataBaseCount: " + cache.UpdateDataBaseCount);
                output.AppendLine("Generation: " + cache.Generation);
                output.AppendLine("LastSaveException: " + GetExceptionTempString(cache.LastSaveException));

                output.AppendLine("");
            }

            return(output.ToString());
        }
Exemplo n.º 3
0
        public SendEventResponse Send()
        {
            if (ComponentControl.IsFake())
            {
                return(ResponseHelper.GetOfflineResponse <SendEventResponse>());
            }

            var client = (Client)ComponentControl.Client;

            return(client.SendEventWrapper(this));
        }
Exemplo n.º 4
0
        protected override string GetDebugInfo()
        {
            var output = new StringBuilder();

            if (ComponentControl == null)
            {
                output.AppendLine("ComponentControl is NULL");
            }
            else
            {
                output.AppendLine("ComponentControl.IsFake()=" + ComponentControl.IsFake());
            }
            output.AppendLine("DispatcherService.Wrapper.RunTime = " + RunTime);
            output.AppendLine("DispatcherService.Wrapper.RunException = " + GetExceptionTempString(RunException));

            // проверка связи с диспетчером
            var adapter  = CreateAdapter("127.0.0.1", "system");
            var response = adapter.GetServerTime();

            output.AppendLine("GetServerTime = " + (response.Success ? response.Data.Date.ToString() : response.ErrorMessage));

            return(output.ToString());
        }