Changed WANavigation to be modifiable
This commit is contained in:
parent
ea9ed51910
commit
846ed78252
8 changed files with 124 additions and 14 deletions
|
|
@ -7,7 +7,8 @@ public interface WAService {
|
|||
UNAVAILABLE,
|
||||
UNKNOWN
|
||||
}
|
||||
|
||||
|
||||
public String getName();
|
||||
public void start();
|
||||
public void stop();
|
||||
public WAServiceStatus getStatus();
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@ public class ApacheService implements WAService {
|
|||
private static OSAbstractionLayer os = OSAbstractionLayer.getInstance();
|
||||
private static final String PID_FILE = "/var/run/apache2.pid";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Apache2";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start() {
|
||||
os.runCommand("service apache2 start");
|
||||
|
|
|
|||
|
|
@ -85,9 +85,8 @@ public class HwStatus implements WAStatus {
|
|||
DataNode procNode = new DataNode(DataType.Map);
|
||||
|
||||
procNode.set("pid", pid);
|
||||
|
||||
procNode.set("mem", sizeByteToMB(sigar.getProcMem(pid).getSize()));
|
||||
try {
|
||||
procNode.set("mem", sizeByteToMB(sigar.getProcMem(pid).getSize()));
|
||||
procNode.set("user", sigar.getProcCredName(pid).getUser());
|
||||
procNode.set("cputime", sigar.getProcTime(pid).getTotal() / 1000);
|
||||
ProcCpu cpu = sigar.getProcCpu(pid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue