?? logfileanalyse.java
字號:
/**
*
*/
package logfileAnalyse;
/**
* @author Jack
*
*/
public class LogfileAnalyse {
/**
* @param args
*/
public static void main(String[] args) {
double begin = 0, end = 0;
if (args.length == 0) {
System.err.println("Please input the log file!");
System.err.println("Usage Example: LogfileAnalyse test.log");
return;
}
else {
if(args[0].endsWith(".log"))
{
EventCount ec = new EventCount(args[0]);
ProcessCount pc = new ProcessCount(args[0]);
ProcessRunTime pt = new ProcessRunTime(args[0]);
ec.calculate();
pc.calculate();
pt.calculate();
begin = ec.getBegin();
end = ec.getEnd();
System.out.println(ec);
System.out.println(pc);
System.out.println(pt);
if( (end - begin) <= 0 ) {
System.out.println("Calculating time error!");
return;
}
else
System.out.printf("Processing data/onelog (%d events) took %2.2f seconds at %2.2f events/second",
ec.getTotalEvents(), (end - begin)/1000, ec.getTotalEvents()*1000/(end - begin));
}
else {
System.err.println("The input file incorrect! Please try again...");
System.err.println("Usage Example: LogfileAnalyse test.log");
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -