jp.ne.mki.wedge.education.hooker
クラス CoverageAnalyzer

java.lang.Object
  上位を拡張 jp.ne.mki.wedge.education.hooker.CoverageAnalyzer

public class CoverageAnalyzer
extends java.lang.Object

全ての実行リストに対して網羅性と実行時間を分析するExecuteHooker。

RunClient設定ファイルにExecuteHookerとして登録すると、 下記のものを記録します。

Frame終了後にこれらをファイルにTab区切りで出力します。 出力するファイル名は「コマンドライン引数」に「-このClassのClass名」をKeyにして定義します。 実際出力するファイル名は指定されたファイル名に 「Frame名称」「Frame実行開始時刻」「拡張子(.log)」 を付加したファイル名が使用されます。
例)-jp.ne.mki.wedge.education.hooker=logs/coverage
logsフォルダ内に「logs/coverage.myframe.10000000.log」 のようなファイル名で出力されます。
コマンドライン引数に指定が無い場合は標準出力に出力されます。

このSampleの場合は構造に対応していないため、 構造ロジッククラス(ExecuteAfter系やIfElseなど)の場合は Treeの子要素となる処理ブロックも込みの実行時間が計上される点に注意してください。
また、Vf本体とは別Threadで実行されるものについては 実行時間は正しい値が記録できません。

作成者:
ogawa

フィールドの概要
protected  long afterMillisecond
          実行後のSystem,currentTimeMillis()
protected  long beforeMillisecond
          実行前のSystem,currentTimeMillis()
protected  java.util.Map<ExecutionInterface,java.lang.Integer> coverageMap
          特定のExecutionInterfaceが何回実行されたか。
protected  java.lang.String frameName
          Frameの名称。
protected  boolean initialized
          初期化済みかどうか。
protected  java.util.Map<ExecutionInterface,java.lang.String> keyMap
          特定のExecutionInterfaceの名称 (TreePathのような、人間で判断できるもの)。
protected  java.util.Map<ExecutionInterface,java.lang.Long> millisecondMap
          特定のExecutionInterfaceが使用した実行時間(ms)。
protected  java.lang.String startTime
          Frame起動時のTimestamp。
 
コンストラクタの概要
CoverageAnalyzer()
           
 
メソッドの概要
protected  void addMap(java.util.List<ExecutionInterface> executions, java.lang.String key)
           
protected  void createMap(ClientManagerInterface manager)
          全ての実行ListをListupする。
 void executeAfter(ExecutionInterface execution, int index, int resultCode)
          処理開始後
 void executeBefore(ExecutionInterface execution, int index, int skipCount)
          処理開始前
protected  void incrementCounter(ExecutionInterface execution)
           実行された回数として1加算する。
protected  void log(java.util.logging.Level level, java.lang.String message)
           
protected  void save()
          結果を出力する。
 void startUp(ExecutionListInterface executionList, javax.swing.JComponent comp, ClientManagerInterface manager)
          実行リスト開始時
 void tearDown(ExecutionListInterface executionList, int result, ClientManagerInterface manager)
          実行リスト終了時
protected  void terminate()
           
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

keyMap

protected java.util.Map<ExecutionInterface,java.lang.String> keyMap
特定のExecutionInterfaceの名称 (TreePathのような、人間で判断できるもの)。


coverageMap

protected java.util.Map<ExecutionInterface,java.lang.Integer> coverageMap
特定のExecutionInterfaceが何回実行されたか。


millisecondMap

protected java.util.Map<ExecutionInterface,java.lang.Long> millisecondMap
特定のExecutionInterfaceが使用した実行時間(ms)。 複数回実行された場合はその総量が記録される。


frameName

protected java.lang.String frameName
Frameの名称。


initialized

protected boolean initialized
初期化済みかどうか。


beforeMillisecond

protected long beforeMillisecond
実行前のSystem,currentTimeMillis()


afterMillisecond

protected long afterMillisecond
実行後のSystem,currentTimeMillis()


startTime

protected java.lang.String startTime
Frame起動時のTimestamp。結果をFile出力する時のFile名の一部に使用する。

コンストラクタの詳細

CoverageAnalyzer

public CoverageAnalyzer()
メソッドの詳細

executeAfter

public void executeAfter(ExecutionInterface execution,
                         int index,
                         int resultCode)
処理開始後

パラメータ:
execution - 実行オブジェクト
index - 実行時のインデックス
resultCode - 戻り値

executeBefore

public void executeBefore(ExecutionInterface execution,
                          int index,
                          int skipCount)
処理開始前

パラメータ:
execution - 実行オブジェクト
index - 実行時のインデックス
skipCount - Skip数

incrementCounter

protected void incrementCounter(ExecutionInterface execution)

パラメータ:
execution -

startUp

public void startUp(ExecutionListInterface executionList,
                    javax.swing.JComponent comp,
                    ClientManagerInterface manager)
実行リスト開始時

パラメータ:
executions - 実行リスト
currentComp - 処理中のコンポーネント
manager - Manager

tearDown

public void tearDown(ExecutionListInterface executionList,
                     int result,
                     ClientManagerInterface manager)
実行リスト終了時

パラメータ:
executions - 実行リスト
result - 戻り値
manager -

save

protected void save()
             throws java.io.IOException
結果を出力する。

例外:
java.io.IOException

createMap

protected void createMap(ClientManagerInterface manager)
全ての実行ListをListupする。

パラメータ:
manager -

terminate

protected void terminate()

addMap

protected void addMap(java.util.List<ExecutionInterface> executions,
                      java.lang.String key)

log

protected void log(java.util.logging.Level level,
                   java.lang.String message)