File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
server/src/main/java/swim/tutorial Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change 12
12
import java .util .Iterator ;
13
13
14
14
public class UnitAgent extends AbstractAgent {
15
+
16
+ // TODO: complete the stats Value Lane
17
+ // @SwimLane("stats")
18
+
19
+ // HINT: Use the valueLane() method to instantiate the lane
20
+ // HINT: Use the .didSet() lifecycle callback to log a message showing updates to stats
21
+
22
+ @ SwimLane ("histogram" )
23
+ private final MapLane <Long , Value > histogram = this .<Long , Value >mapLane ()
24
+ .didUpdate ((k , n , o ) -> {
25
+ logMessage ("histogram: replaced " + k + "'s value to " + Recon .toString (n ) + " from " + Recon .toString (o ));
26
+ // TODO: update stats with update logic
27
+
28
+ dropOldData ();
15
29
16
- @ SwimLane ("histogram" )
17
- private final MapLane <Long , Value > histogram = this .<Long , Value >mapLane ()
18
- .didUpdate ((k , n , o ) -> {
19
- logMessage ("histogram: replaced " + k + "'s value to " + Recon .toString (n ) + " from " + Recon .toString (o ));
20
- dropOldData ();
21
- });
30
+ })
31
+ .didRemove ((k ,o ) -> {
32
+ // TODO: update stats with remove logic
22
33
34
+ });
35
+
23
36
@ SwimLane ("history" )
24
37
private final ListLane <Value > history = this .<Value >listLane ()
25
38
.didUpdate ((idx , newValue , oldValue ) -> {
You can’t perform that action at this time.
0 commit comments