All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aol.micro.server.machine.stats.sigar.rest.StatsResource Maven / Gradle / Ivy

There is a newer version: 0.91.11
Show newest version
package com.aol.micro.server.machine.stats.sigar.rest;



import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.hyperic.sigar.Sigar;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.aol.micro.server.auto.discovery.SingletonRestResource;
import com.aol.micro.server.machine.stats.sigar.MachineStats;
import com.aol.micro.server.machine.stats.sigar.MachineStatsChecker;

@Path("/stats")
public class StatsResource implements SingletonRestResource {

	
	private final MachineStatsChecker machineStatsChecker;
	
	@Autowired
	public StatsResource(MachineStatsChecker machineStatsChecker){
		this.machineStatsChecker = machineStatsChecker;
	}

	@GET
	@Path("/machine")
	@Produces("application/json")
	public MachineStats getMachineStats() {
		return machineStatsChecker.getStats(new Sigar());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy