public SystemPerformanceDataProvider(IAgentControlDefinitionProvider agentControlDefinitionProvider, IProcessorStatusProvider processorStatusProvider, ISystemMemoryStatusProvider systemMemoryStatusProvider, ISystemStorageStatusProvider systemStorageStatusProvider) { if (agentControlDefinitionProvider == null) { throw new ArgumentNullException("agentControlDefinitionProvider"); } if (processorStatusProvider == null) { throw new ArgumentNullException("processorStatusProvider"); } if (systemMemoryStatusProvider == null) { throw new ArgumentNullException("systemMemoryStatusProvider"); } if (systemStorageStatusProvider == null) { throw new ArgumentNullException("systemStorageStatusProvider"); } this.agentControlDefinitionProvider = agentControlDefinitionProvider; this.processorStatusProvider = processorStatusProvider; this.systemMemoryStatusProvider = systemMemoryStatusProvider; this.systemStorageStatusProvider = systemStorageStatusProvider; // get initial check interval var agentControlDefinition = this.agentControlDefinitionProvider.GetControlDefinition(); int checkIntervalInSeconds = DefaultCheckIntervalInSeconds; if (agentControlDefinition != null && agentControlDefinition.HttpStatusCodeCheck != null && agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds > 0) { checkIntervalInSeconds = agentControlDefinition.HttpStatusCodeCheck.CheckIntervalInSeconds; } var timerStartTime = new TimeSpan(0, 0, 0); var timerInterval = new TimeSpan(0, 0, 0, checkIntervalInSeconds); this.timer = new Timer(state => this.UpdateSystemPerformanceData(), null, timerStartTime, timerInterval); }