Caudit應(yīng)用性能跟蹤庫(kù)
Caudit 是一個(gè)簡(jiǎn)單的庫(kù)用來(lái)記錄應(yīng)用程序的性能、健康狀態(tài)和運(yùn)行相關(guān)的統(tǒng)計(jì)信息。它具有兩種基本的審核類型:秒表和數(shù)量。秒表是你跟蹤特定操作所經(jīng)過(guò)的時(shí)間的表,數(shù)量是你要監(jiān)視的變量。
示例代碼:
//Mapping audit to integer is for performance(string comparison vs integer comparison)
private final static int BASIC_STOPWATCH_ID = Audits.mapAudit("example.basicStopwatch");
public void tryOut(){
final Stopwatch stopwatch = Audits.getBasicStopwatch(BASIC_STOPWATCH_ID);
stopwatch.start();
doSomeWork();
stopwatch.stop();
}評(píng)論
圖片
表情
