package org.bench4q.monitor.service.windows;

import org.bench4q.monitor.model.SystemModel;
import org.bench4q.monitor.performance.windows.ProcessorMonitor;
import org.bench4q.monitor.performance.windows.SystemMonitor;

public class SystemServiceWindows {
	
	public SystemServiceWindows(){
		this.systemMonitor=new SystemMonitor();
		this.processorMonitor=new ProcessorMonitor();
	}
	private SystemMonitor systemMonitor;
	private ProcessorMonitor processorMonitor;
	public SystemMonitor getSystemMonitor() {
		return systemMonitor;
	}
	public void setSystemMonitor(SystemMonitor systemMonitor) {
		this.systemMonitor = systemMonitor;
	}
	public ProcessorMonitor getProcessorMonitor() {
		return processorMonitor;
	}
	public void setProcessorMonitor(ProcessorMonitor processorMonitor) {
		this.processorMonitor = processorMonitor;
	}
	
	public SystemModel getSystemInfo(int idleTime){
		SystemModel systemModel=new SystemModel();
		
		systemModel.setFileDataOperationsPerSecond(this.getSystemMonitor().getFileDataOperationsPerSecond(idleTime));
	    systemModel.setProcessorQueueLength(this.getSystemMonitor().getProcessorQueueLength());
		double totalProceesorTimePercent=this.getProcessorMonitor().getProcessorTimePercent("_Total", idleTime);
		systemModel.setTotalProceesorTimePercent(totalProceesorTimePercent);
		return systemModel;
	}
}
