Beispiel #1
0
 internal void AddTotalReport()
 {
     dtReport.Rows.Add(new object[] {
         "Report",
         "Summarize",
         ItemsCount,
         RequestCount,
         EnqueueCount,
         DequeueCount,
         DequeueCountPerHour,
         DequeueCountPerDay,
         DequeueCountPerMonth,
         SyncCount,
         StartTime,
         LastRequestTime,
         LastDequeueTime,
         LastSyncTime,
         MaxHitPerMinute,
         AvgHitPerMinute,
         //AvgDequeueTime,
         AvgSyncTime,
         MaxSize,
         MemoSize,
         FreeSize,
         QueuePerformanceCounter.GetMemoryUsage()
     });
 }
Beispiel #2
0
        internal void AddItemReport(QueuePerformanceCounter agent)
        {
            dtReport.Rows.Add(agent.GetItemArray());

            ItemsCount           += agent.ItemsCount;
            RequestCount         += agent.RequestCount;
            EnqueueCount         += agent.EnqueueCount;
            DequeueCount         += agent.DequeueCount;
            DequeueCountPerHour  += agent.DequeueCountPerHour;
            DequeueCountPerDay   += agent.DequeueCountPerDay;
            DequeueCountPerMonth += agent.DequeueCountPerMonth;
            FreeSize             += agent.FreeSize;
            MaxSize   += agent.MaxSize;
            MemoSize  += agent.MemoSize;
            SyncCount += agent.SyncCount;

            //if (AvgDequeueTime > 0 && agent.AvgDequeueTime > 0)
            //    AvgDequeueTime = (AvgDequeueTime + agent.AvgDequeueTime) / 2;
            //else if (agent.AvgDequeueTime > 0)
            //    AvgDequeueTime = agent.AvgDequeueTime;

            if (AvgSyncTime > 0 && agent.AvgSyncTime > 0)
            {
                AvgSyncTime = (AvgSyncTime + agent.AvgSyncTime) / 2;
            }
            else if (agent.AvgSyncTime > 0)
            {
                AvgSyncTime = agent.AvgSyncTime;
            }

            if (AvgHitPerMinute > 0 && agent.AvgHitPerMinute > 0)
            {
                AvgHitPerMinute = (AvgHitPerMinute + agent.AvgHitPerMinute) / 2;
            }
            else if (agent.AvgHitPerMinute > 0)
            {
                AvgHitPerMinute = agent.AvgHitPerMinute;
            }

            MaxHitPerMinute = Math.Max(MaxHitPerMinute, agent.MaxHitPerMinute);

            StartTime       = agent.StartTime > StartTime ? StartTime : agent.StartTime;
            LastRequestTime = agent.LastRequestTime < LastRequestTime ? LastRequestTime : agent.LastRequestTime;
            LastDequeueTime = agent.LastDequeueTime < LastDequeueTime ? LastDequeueTime : agent.LastDequeueTime;
            LastSyncTime    = agent.LastSyncTime < LastSyncTime ? LastSyncTime : agent.LastSyncTime;

            //dtSum = QueuePerformanceCounter.QueuePerformanceSchema();
        }
Beispiel #3
0
        /// <summary>
        /// MQueue Ctor
        /// </summary>
        /// <param name="mqp"></param>
        public MQueue(IQProperties prop)
        {
            Logger = QLogger.Logger.ILog;

            Console.WriteLine("Init MQueue " + prop);

            LogActionInfo("MQueue ctor", "Init MQueue " + prop.Print());

            TimeStarted = DateTime.Now;
            LOCK();

            m_enabled = true;

            //m_Server = prop.Server;
            m_QueueName = prop.QueueName;
            m_CoverMode = prop.Mode;
            m_maxRetry  = prop.MaxRetry;
            m_isTrans   = prop.IsTrans;
            IsTopic     = prop.IsTopic;
            TargetPath  = prop.TargetPath;

            RoutHost = prop.GetRoutHost();
            if (IsCoverable)
            {
                //_QCover = new QCover()
                //{
                //    ConnectTimeout = prop.ConnectTimeout,
                //    CoverProvider = IsDbQueue ? CoverProviders.Db : CoverProviders.File,
                //    CoverPath = prop.CoverPath
                //};
                m_QueuesPath = AgentManager.Settings.QueuesPath;
            }
            if (IsTopic)
            {
                Topic = new TopicController(this);
            }

            resetEvent = new ManualResetEvent(false);

            m_Perfmon = new QueuePerformanceCounter(this, QueueAgentType.MQueue, m_QueueName);


            //Q = prop.Factory();
            Q        = new PriorityComplexQueue(prop);
            Q.Logger = Logger;

            Q.MessageArrived   += new QueueItemEventHandler(Q_MessageArrived);
            Q.MessageReceived  += new QueueItemEventHandler(Q_MessageReceived);
            Q.TransactionBegin += new QueueItemEventHandler(Q_MessageTransBegin);
            Q.TransactionEnd   += new QueueItemEventHandler(Q_MessageTransEnd);
            Q.ErrorOccured     += new QueueItemEventHandler(Q_ErrorOccured);
            //InitRecoverQueue(DefaultIntervalMinuteRecover);

            if (prop.ReloadOnStart)
            {
                Q.ReloadItemsInternal();
            }

            UNLOCK();
            //if (recoverable)
            //{
            //    InitRecoverQueue(DefaultIntervalMinuteRecover);
            //}
            //else
            //{
            //    UNLOCK();
            //}
        }
Beispiel #4
0
 /// <summary>
 /// Initialize a new instance of cache performance report.
 /// </summary>
 /// <param name="agent"></param>
 public QueuePerformanceReport(QueueAgentType agent)
 {
     dtReport    = QueuePerformanceCounter.QueuePerformanceSchema();
     CounterName = agent.ToString();
 }
Beispiel #5
0
 /// <summary>
 /// Initialize a new instance of cache performance report.
 /// </summary>
 public QueuePerformanceReport()
 {
     dtReport    = QueuePerformanceCounter.QueuePerformanceSchema();
     CounterName = "SummarizeReport";
 }