Beispiel #1
0
        public PerformanceMonitor(IRootConfig config, IEnumerable<IWorkItem> appServers, IWorkItem serverManager, ILogFactory logFactory)
        {
            m_PerfLog = logFactory.GetLog("Performance");

            m_AppServers = appServers.ToArray();

            m_ServerManager = serverManager;

            m_Helper = new ProcessPerformanceCounterHelper(Process.GetCurrentProcess());

            m_TimerInterval = config.PerformanceDataCollectInterval * 1000;
            m_PerformanceTimer = new Timer(OnPerformanceTimerCallback);
        }
Beispiel #2
0
        public void Dispose()
        {
            if (m_PerformanceTimer != null)
            {
                m_PerformanceTimer.Dispose();
                m_PerformanceTimer = null;
            }

            if (m_Helper != null)
            {
                m_Helper.Dispose();
                m_Helper = null;
            }
        }