EMMA Coverage Report (generated Sun Aug 17 11:20:34 PDT 2014)
[all classes][net.digitaltsunami.tmeter.action]

COVERAGE SUMMARY FOR SOURCE FILE [TimeRecorderAction.java]

nameclass, %method, %block, %line, %
TimeRecorderAction.java100% (1/1)100% (2/2)100% (11/11)100% (5/5)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TimeRecorderAction100% (1/1)100% (2/2)100% (11/11)100% (5/5)
TimeRecorderAction (TimeRecorder): void 100% (1/1)100% (6/6)100% (3/3)
processTimer (Timer): void 100% (1/1)100% (5/5)100% (2/2)

1package net.digitaltsunami.tmeter.action;
2 
3import net.digitaltsunami.tmeter.TimeTracker;
4import net.digitaltsunami.tmeter.Timer;
5import net.digitaltsunami.tmeter.record.NullTimeRecorder;
6import net.digitaltsunami.tmeter.record.QueuedTimeRecorder;
7import net.digitaltsunami.tmeter.record.TimeRecorder;
8 
9/**
10 * {@link TimerAction} that records {@link Timer}s. This action can be part of
11 * an {@link ActionChain} and can be used to record timers to multiple locations
12 * or just to move the recording off of the timed process's thread. 
13 * Not necessary for simple time recorders, but for
14 * those that might cause a delay it is better to move the recording task to
15 * another thread.
16 * <p>
17 * There are a couple of ways to use this action:
18 * <ol>
19 * <li>Using the {@link QueuedTimeRecorder}. This recorder uses
20 * {@link TimeRecorderAction} and performs all recording on a separate thread.
21 * <ol>
22 * <li>Create an instance of {@link QueuedTimeRecorder}
23 * <li>Set the {@link TimeTracker#setDefaultTimeRecorder(queuedTimeRecorder)}
24 * </ol>
25 * <li>As part of an action chain
26 * <ol>
27 * <li>Create an instance of this class with an implementation of
28 * {@link TimeRecorder}
29 * <li>Add the instance to the TimeTracker action chain using
30 * {@link TimeTracker#addAction(TimerAction)}
31 * <li>If the processing threads should not record the timers, then set the default time 
32 * recorder for TimeTracker to {@link NullTimeRecorder}
33 * using {@link TimeTracker#setDefaultTimeRecorder(TimeRecorder)}.
34 * </ol>
35 * </ol>
36 * 
37 * @author dhagberg
38 * 
39 */
40public class TimeRecorderAction extends TimerAction {
41    private final TimeRecorder recorder;
42 
43    public TimeRecorderAction(TimeRecorder recorder) {
44        this.recorder = recorder;
45    }
46 
47    @Override
48    protected void processTimer(Timer timer) {
49        recorder.record(timer);
50    }
51 
52}

[all classes][net.digitaltsunami.tmeter.action]
EMMA 2.1.5320 (stable) (C) Vladimir Roubtsov