Template of Windows TypePerf cmd and Impl a CSVParser class+test
This commit is contained in:
parent
216f6dcb9b
commit
315932070a
11 changed files with 349 additions and 18 deletions
|
|
@ -25,7 +25,7 @@ package zutil.osal;
|
|||
/**
|
||||
* Created by Ziver on 2015-04-07.
|
||||
*/
|
||||
public class HALLinuxImpl implements HardwareAbstractionLayer{
|
||||
public class HalLinuxImpl implements HardwareAbstractionLayer{
|
||||
|
||||
protected HALLinuxImpl(){}
|
||||
protected HalLinuxImpl(){}
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ import java.io.File;
|
|||
* User: Ziver
|
||||
*/
|
||||
public class OsalLinuxImpl extends OSAbstractionLayer {
|
||||
private static HALLinuxImpl hal;
|
||||
private static HalLinuxImpl hal;
|
||||
|
||||
@Override
|
||||
public OSType getOSType() {
|
||||
|
|
@ -78,7 +78,7 @@ public class OsalLinuxImpl extends OSAbstractionLayer {
|
|||
@Override
|
||||
public HardwareAbstractionLayer getHAL() {
|
||||
if(hal == null)
|
||||
hal = new HALLinuxImpl();
|
||||
hal = new HalLinuxImpl();
|
||||
return hal;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
package zutil.osal.app.linux;
|
||||
|
||||
import zutil.log.LogUtil;
|
||||
import zutil.Timer;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
|
|
@ -46,13 +47,13 @@ public class ProcStat {
|
|||
private static ArrayList<CpuStats> cpus = new ArrayList<CpuStats>();
|
||||
private static long uptime;
|
||||
private static long processes;
|
||||
private static long updateTimestamp;
|
||||
private static Timer updateTimer = new Timer(TTL);
|
||||
|
||||
|
||||
private synchronized static void update(){
|
||||
if(System.currentTimeMillis() - updateTimestamp < TTL)
|
||||
if(updateTimer.hasTimedOut())
|
||||
return;
|
||||
updateTimestamp = System.currentTimeMillis();
|
||||
updateTimer.start();
|
||||
try {
|
||||
BufferedReader in = new BufferedReader(new FileReader(PROC_PATH));
|
||||
String line = null;
|
||||
|
|
|
|||
57
src/zutil/osal/app/windows/TypePerf.java
Normal file
57
src/zutil/osal/app/windows/TypePerf.java
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue