blob: 47844753b5aa5b46e2415c9cf5265dd8cc02165d [file] [log] [blame]
Brian O'Connora468e902015-03-18 16:43:49 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Brian O'Connora468e902015-03-18 16:43:49 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.intentperf;
17
18import com.google.common.collect.ArrayListMultimap;
19import com.google.common.collect.Lists;
20import com.google.common.collect.Maps;
21import com.google.common.collect.Multimap;
22import com.google.common.collect.Sets;
23import org.apache.commons.lang.math.RandomUtils;
24import org.apache.felix.scr.annotations.Activate;
25import org.apache.felix.scr.annotations.Component;
26import org.apache.felix.scr.annotations.Deactivate;
27import org.apache.felix.scr.annotations.Modified;
28import org.apache.felix.scr.annotations.Property;
29import org.apache.felix.scr.annotations.Reference;
30import org.apache.felix.scr.annotations.ReferenceCardinality;
31import org.apache.felix.scr.annotations.Service;
32import org.onlab.packet.MacAddress;
33import org.onlab.util.Counter;
34import org.onosproject.cfg.ComponentConfigService;
35import org.onosproject.cluster.ClusterService;
36import org.onosproject.cluster.ControllerNode;
37import org.onosproject.cluster.NodeId;
38import org.onosproject.core.ApplicationId;
39import org.onosproject.core.CoreService;
40import org.onosproject.mastership.MastershipService;
41import org.onosproject.net.ConnectPoint;
42import org.onosproject.net.Device;
Ray Milkeya2cf3a12018-02-15 16:13:56 -080043import org.onosproject.net.FilteredConnectPoint;
Brian O'Connora468e902015-03-18 16:43:49 -070044import org.onosproject.net.PortNumber;
45import org.onosproject.net.device.DeviceService;
46import org.onosproject.net.flow.DefaultTrafficSelector;
47import org.onosproject.net.flow.DefaultTrafficTreatment;
48import org.onosproject.net.flow.TrafficSelector;
49import org.onosproject.net.flow.TrafficTreatment;
50import org.onosproject.net.intent.Intent;
51import org.onosproject.net.intent.IntentEvent;
52import org.onosproject.net.intent.IntentListener;
53import org.onosproject.net.intent.IntentService;
54import org.onosproject.net.intent.Key;
Madan Jampani3b8101a2016-09-15 13:22:01 -070055import org.onosproject.net.intent.WorkPartitionService;
Brian O'Connora468e902015-03-18 16:43:49 -070056import org.onosproject.net.intent.PointToPointIntent;
57import org.onosproject.store.cluster.messaging.ClusterCommunicationService;
Brian O'Connora468e902015-03-18 16:43:49 -070058import org.onosproject.store.cluster.messaging.MessageSubject;
59import org.osgi.service.component.ComponentContext;
60import org.slf4j.Logger;
61
62import java.util.ArrayList;
63import java.util.Collections;
64import java.util.Dictionary;
65import java.util.List;
66import java.util.Map;
67import java.util.Set;
68import java.util.Timer;
69import java.util.TimerTask;
70import java.util.concurrent.ExecutorService;
71import java.util.concurrent.Executors;
72import java.util.concurrent.TimeUnit;
Sho SHIMIZUc032c832016-01-13 13:02:05 -080073import java.util.function.Consumer;
Brian O'Connora468e902015-03-18 16:43:49 -070074import java.util.stream.Collectors;
75
76import static com.google.common.base.Preconditions.checkState;
77import static com.google.common.base.Strings.isNullOrEmpty;
78import static java.lang.String.format;
79import static java.lang.System.currentTimeMillis;
80import static org.apache.felix.scr.annotations.ReferenceCardinality.MANDATORY_UNARY;
81import static org.onlab.util.Tools.*;
82import static org.onosproject.net.intent.IntentEvent.Type.*;
83import static org.slf4j.LoggerFactory.getLogger;
84
85/**
86 * Application to test sustained intent throughput.
87 */
88@Component(immediate = true)
89@Service(value = IntentPerfInstaller.class)
90public class IntentPerfInstaller {
91
92 private final Logger log = getLogger(getClass());
93
94 private static final int DEFAULT_NUM_WORKERS = 1;
95
96 private static final int DEFAULT_NUM_KEYS = 40000;
97 private static final int DEFAULT_GOAL_CYCLE_PERIOD = 1000; //ms
98
99 private static final int DEFAULT_NUM_NEIGHBORS = 0;
100
101 private static final int START_DELAY = 5_000; // ms
Thomas Vachuska95aadff2015-03-26 11:45:41 -0700102 private static final int REPORT_PERIOD = 1_000; //ms
Brian O'Connora468e902015-03-18 16:43:49 -0700103
104 private static final String START = "start";
105 private static final String STOP = "stop";
106 private static final MessageSubject CONTROL = new MessageSubject("intent-perf-ctl");
107
108 //FIXME add path length
109
110 @Property(name = "numKeys", intValue = DEFAULT_NUM_KEYS,
111 label = "Number of keys (i.e. unique intents) to generate per instance")
112 private int numKeys = DEFAULT_NUM_KEYS;
113
114 //TODO implement numWorkers property
115// @Property(name = "numThreads", intValue = DEFAULT_NUM_WORKERS,
116// label = "Number of installer threads per instance")
117// private int numWokers = DEFAULT_NUM_WORKERS;
118
119 @Property(name = "cyclePeriod", intValue = DEFAULT_GOAL_CYCLE_PERIOD,
120 label = "Goal for cycle period (in ms)")
121 private int cyclePeriod = DEFAULT_GOAL_CYCLE_PERIOD;
122
123 @Property(name = "numNeighbors", intValue = DEFAULT_NUM_NEIGHBORS,
124 label = "Number of neighbors to generate intents for")
125 private int numNeighbors = DEFAULT_NUM_NEIGHBORS;
126
127 @Reference(cardinality = MANDATORY_UNARY)
128 protected CoreService coreService;
129
130 @Reference(cardinality = MANDATORY_UNARY)
131 protected IntentService intentService;
132
133 @Reference(cardinality = MANDATORY_UNARY)
134 protected ClusterService clusterService;
135
136 @Reference(cardinality = MANDATORY_UNARY)
137 protected DeviceService deviceService;
138
139 @Reference(cardinality = MANDATORY_UNARY)
140 protected MastershipService mastershipService;
141
142 @Reference(cardinality = MANDATORY_UNARY)
Madan Jampani3b8101a2016-09-15 13:22:01 -0700143 protected WorkPartitionService partitionService;
Brian O'Connora468e902015-03-18 16:43:49 -0700144
145 @Reference(cardinality = MANDATORY_UNARY)
146 protected ComponentConfigService configService;
147
148 @Reference(cardinality = MANDATORY_UNARY)
149 protected IntentPerfCollector sampleCollector;
150
151 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
152 protected ClusterCommunicationService communicationService;
153
154 private ExecutorService messageHandlingExecutor;
155
156 private ExecutorService workers;
157 private ApplicationId appId;
158 private Listener listener;
Thomas Vachuskab967ebf2015-03-28 15:19:30 -0700159 private boolean stopped = true;
Brian O'Connora468e902015-03-18 16:43:49 -0700160
161 private Timer reportTimer;
162
163 // FIXME this variable isn't shared properly between multiple worker threads
164 private int lastKey = 0;
165
166 private IntentPerfUi perfUi;
167 private NodeId nodeId;
168 private TimerTask reporterTask;
169
170 @Activate
171 public void activate(ComponentContext context) {
172 configService.registerProperties(getClass());
173
174 nodeId = clusterService.getLocalNode().id();
175 appId = coreService.registerApplication("org.onosproject.intentperf." + nodeId.toString());
176
177 // TODO: replace with shared timer
178 reportTimer = new Timer("onos-intent-perf-reporter");
179 workers = Executors.newFixedThreadPool(DEFAULT_NUM_WORKERS, groupedThreads("onos/intent-perf", "worker-%d"));
180
Brian O'Connora468e902015-03-18 16:43:49 -0700181 // TODO: replace with shared executor
182 messageHandlingExecutor = Executors.newSingleThreadExecutor(
183 groupedThreads("onos/perf", "command-handler"));
184
Sho SHIMIZUc032c832016-01-13 13:02:05 -0800185 communicationService.addSubscriber(CONTROL, String::new, new InternalControl(),
Brian O'Connora468e902015-03-18 16:43:49 -0700186 messageHandlingExecutor);
187
188 listener = new Listener();
189 intentService.addListener(listener);
190
191 // TODO: investigate why this seems to be necessary for configs to get picked up on initial activation
192 modify(context);
193 }
194
195 @Deactivate
196 public void deactivate() {
197 stopTestRun();
198
199 configService.unregisterProperties(getClass(), false);
200 messageHandlingExecutor.shutdown();
201 communicationService.removeSubscriber(CONTROL);
202
203 if (listener != null) {
204 reportTimer.cancel();
205 intentService.removeListener(listener);
206 listener = null;
207 reportTimer = null;
208 }
209 }
210
211 @Modified
212 public void modify(ComponentContext context) {
213 if (context == null) {
214 logConfig("Reconfigured");
215 return;
216 }
217
218 Dictionary<?, ?> properties = context.getProperties();
219 int newNumKeys, newCyclePeriod, newNumNeighbors;
220 try {
221 String s = get(properties, "numKeys");
222 newNumKeys = isNullOrEmpty(s) ? numKeys : Integer.parseInt(s.trim());
223
224 s = get(properties, "cyclePeriod");
225 newCyclePeriod = isNullOrEmpty(s) ? cyclePeriod : Integer.parseInt(s.trim());
226
227 s = get(properties, "numNeighbors");
228 newNumNeighbors = isNullOrEmpty(s) ? numNeighbors : Integer.parseInt(s.trim());
229
230 } catch (NumberFormatException | ClassCastException e) {
231 log.warn("Malformed configuration detected; using defaults", e);
232 newNumKeys = DEFAULT_NUM_KEYS;
233 newCyclePeriod = DEFAULT_GOAL_CYCLE_PERIOD;
234 newNumNeighbors = DEFAULT_NUM_NEIGHBORS;
235 }
236
237 if (newNumKeys != numKeys || newCyclePeriod != cyclePeriod || newNumNeighbors != numNeighbors) {
238 numKeys = newNumKeys;
239 cyclePeriod = newCyclePeriod;
240 numNeighbors = newNumNeighbors;
241 logConfig("Reconfigured");
242 }
243 }
244
245 public void start() {
Thomas Vachuskab967ebf2015-03-28 15:19:30 -0700246 if (stopped) {
247 stopped = false;
Madan Jampani2bfa94c2015-04-11 05:03:49 -0700248 communicationService.broadcast(START, CONTROL, str -> str.getBytes());
Thomas Vachuskab967ebf2015-03-28 15:19:30 -0700249 startTestRun();
250 }
Brian O'Connora468e902015-03-18 16:43:49 -0700251 }
252
253 public void stop() {
Thomas Vachuskab967ebf2015-03-28 15:19:30 -0700254 if (!stopped) {
Madan Jampani2bfa94c2015-04-11 05:03:49 -0700255 communicationService.broadcast(STOP, CONTROL, str -> str.getBytes());
Thomas Vachuskab967ebf2015-03-28 15:19:30 -0700256 stopTestRun();
257 }
Brian O'Connora468e902015-03-18 16:43:49 -0700258 }
259
260 private void logConfig(String prefix) {
261 log.info("{} with appId {}; numKeys = {}; cyclePeriod = {} ms; numNeighbors={}",
262 prefix, appId.id(), numKeys, cyclePeriod, numNeighbors);
263 }
264
265 private void startTestRun() {
266 sampleCollector.clearSamples();
267
268 // adjust numNeighbors and generate list of neighbors
269 numNeighbors = Math.min(clusterService.getNodes().size() - 1, numNeighbors);
270
271 // Schedule reporter task on report period boundary
272 reporterTask = new ReporterTask();
273 reportTimer.scheduleAtFixedRate(reporterTask,
274 REPORT_PERIOD - currentTimeMillis() % REPORT_PERIOD,
275 REPORT_PERIOD);
276
277 // Submit workers
278 stopped = false;
279 for (int i = 0; i < DEFAULT_NUM_WORKERS; i++) {
280 workers.submit(new Submitter(createIntents(numKeys, /*FIXME*/ 2, lastKey)));
281 }
282 log.info("Started test run");
283 }
284
285 private void stopTestRun() {
Brian O'Connora468e902015-03-18 16:43:49 -0700286 if (reporterTask != null) {
287 reporterTask.cancel();
288 reporterTask = null;
289 }
290
291 try {
Ray Milkey3717e602018-02-01 13:49:47 -0800292 workers.awaitTermination(5L * cyclePeriod, TimeUnit.MILLISECONDS);
Brian O'Connora468e902015-03-18 16:43:49 -0700293 } catch (InterruptedException e) {
294 log.warn("Failed to stop worker", e);
295 }
Thomas Vachuskab967ebf2015-03-28 15:19:30 -0700296
297 sampleCollector.recordSample(0, 0);
298 sampleCollector.recordSample(0, 0);
299 stopped = true;
300
Brian O'Connora468e902015-03-18 16:43:49 -0700301 log.info("Stopped test run");
302 }
303
304 private List<NodeId> getNeighbors() {
305 List<NodeId> nodes = clusterService.getNodes().stream()
306 .map(ControllerNode::id)
307 .collect(Collectors.toCollection(ArrayList::new));
308 // sort neighbors by id
309 Collections.sort(nodes, (node1, node2) ->
310 node1.toString().compareTo(node2.toString()));
311 // rotate the local node to index 0
312 Collections.rotate(nodes, -1 * nodes.indexOf(clusterService.getLocalNode().id()));
313 log.debug("neighbors (raw): {}", nodes); //TODO remove
314 // generate the sub-list that will contain local node and selected neighbors
315 nodes = nodes.subList(0, numNeighbors + 1);
316 log.debug("neighbors: {}", nodes); //TODO remove
317 return nodes;
318 }
319
320 private Intent createIntent(Key key, long mac, NodeId node, Multimap<NodeId, Device> devices) {
321 // choose a random device for which this node is master
322 List<Device> deviceList = devices.get(node).stream().collect(Collectors.toList());
323 Device device = deviceList.get(RandomUtils.nextInt(deviceList.size()));
324
325 //FIXME we currently ignore the path length and always use the same device
326 TrafficSelector selector = DefaultTrafficSelector.builder()
327 .matchEthDst(MacAddress.valueOf(mac)).build();
328 TrafficTreatment treatment = DefaultTrafficTreatment.emptyTreatment();
329 ConnectPoint ingress = new ConnectPoint(device.id(), PortNumber.portNumber(1));
330 ConnectPoint egress = new ConnectPoint(device.id(), PortNumber.portNumber(2));
331
332 return PointToPointIntent.builder()
333 .appId(appId)
334 .key(key)
335 .selector(selector)
336 .treatment(treatment)
Ray Milkeya2cf3a12018-02-15 16:13:56 -0800337 .filteredIngressPoint(new FilteredConnectPoint(ingress))
338 .filteredEgressPoint(new FilteredConnectPoint(egress))
Brian O'Connora468e902015-03-18 16:43:49 -0700339 .build();
340 }
341
342 /**
343 * Creates a specified number of intents for testing purposes.
344 *
345 * @param numberOfKeys number of intents
346 * @param pathLength path depth
347 * @param firstKey first key to attempt
348 * @return set of intents
349 */
350 private Set<Intent> createIntents(int numberOfKeys, int pathLength, int firstKey) {
351 List<NodeId> neighbors = getNeighbors();
352
353 Multimap<NodeId, Device> devices = ArrayListMultimap.create();
354 deviceService.getAvailableDevices()
355 .forEach(device -> devices.put(mastershipService.getMasterFor(device.id()), device));
356
357 // ensure that we have at least one device per neighbor
Jon Hallcbd1b392017-01-18 20:15:44 -0800358 neighbors.forEach(node -> checkState(!devices.get(node).isEmpty(),
Brian O'Connora468e902015-03-18 16:43:49 -0700359 "There are no devices for {}", node));
360
361 // TODO pull this outside so that createIntent can use it
362 // prefix based on node id for keys generated on this instance
363 long keyPrefix = ((long) clusterService.getLocalNode().ip().getIp4Address().toInt()) << 32;
364
365 int maxKeysPerNode = (int) Math.ceil((double) numberOfKeys / neighbors.size());
366 Multimap<NodeId, Intent> intents = ArrayListMultimap.create();
367
368 for (int count = 0, k = firstKey; count < numberOfKeys; k++) {
369 Key key = Key.of(keyPrefix + k, appId);
370
Madan Jampani3b8101a2016-09-15 13:22:01 -0700371 NodeId leader = partitionService.getLeader(key, Key::hash);
Brian O'Connora468e902015-03-18 16:43:49 -0700372 if (!neighbors.contains(leader) || intents.get(leader).size() >= maxKeysPerNode) {
373 // Bail if we are not sending to this node or we have enough for this node
374 continue;
375 }
376 intents.put(leader, createIntent(key, keyPrefix + k, leader, devices));
377
378 // Bump up the counter and remember this as the last key used.
379 count++;
380 lastKey = k;
381 if (count % 1000 == 0) {
382 log.info("Building intents... {} (attempt: {})", count, lastKey);
383 }
384 }
385 checkState(intents.values().size() == numberOfKeys,
386 "Generated wrong number of intents");
387 log.info("Created {} intents", numberOfKeys);
388 intents.keySet().forEach(node -> log.info("\t{}\t{}", node, intents.get(node).size()));
389
390 return Sets.newHashSet(intents.values());
391 }
392
Yi Tseng356d1252017-05-25 16:01:58 -0700393 final Set<Intent> submitted = Sets.newConcurrentHashSet();
394 final Set<Intent> withdrawn = Sets.newConcurrentHashSet();
395
Brian O'Connora468e902015-03-18 16:43:49 -0700396 // Submits intent operations.
397 final class Submitter implements Runnable {
398
399 private long lastDuration;
400 private int lastCount;
401
402 private Set<Intent> intents = Sets.newHashSet();
Yi Tseng356d1252017-05-25 16:01:58 -0700403
Brian O'Connora468e902015-03-18 16:43:49 -0700404
405 private Submitter(Set<Intent> intents) {
406 this.intents = intents;
407 lastCount = numKeys / 4;
408 lastDuration = 1_000; // 1 second
409 }
410
411 @Override
412 public void run() {
413 prime();
414 while (!stopped) {
415 try {
416 cycle();
417 } catch (Exception e) {
418 log.warn("Exception during cycle", e);
419 }
420 }
421 clear();
422 }
423
424 private Iterable<Intent> subset(Set<Intent> intents) {
425 List<Intent> subset = Lists.newArrayList(intents);
426 Collections.shuffle(subset);
Yi Tseng356d1252017-05-25 16:01:58 -0700427 return subset.subList(0, Math.min(subset.size(), lastCount));
Brian O'Connora468e902015-03-18 16:43:49 -0700428 }
429
430 // Submits the specified intent.
431 private void submit(Intent intent) {
432 intentService.submit(intent);
Brian O'Connora468e902015-03-18 16:43:49 -0700433 withdrawn.remove(intent); //TODO could check result here...
434 }
435
436 // Withdraws the specified intent.
437 private void withdraw(Intent intent) {
438 intentService.withdraw(intent);
Brian O'Connora468e902015-03-18 16:43:49 -0700439 submitted.remove(intent); //TODO could check result here...
440 }
441
442 // Primes the cycle.
443 private void prime() {
444 int i = 0;
445 withdrawn.addAll(intents);
446 for (Intent intent : intents) {
447 submit(intent);
448 // only submit half of the intents to start
449 if (i++ >= intents.size() / 2) {
450 break;
451 }
452 }
453 }
454
455 private void clear() {
456 submitted.forEach(this::withdraw);
457 }
458
459 // Runs a single operation cycle.
460 private void cycle() {
461 //TODO consider running without rate adjustment
462 adjustRates();
463
464 long start = currentTimeMillis();
465 subset(submitted).forEach(this::withdraw);
466 subset(withdrawn).forEach(this::submit);
467 long delta = currentTimeMillis() - start;
468
469 if (delta > cyclePeriod * 3 || delta < 0) {
470 log.warn("Cycle took {} ms", delta);
471 }
472
473 int difference = cyclePeriod - (int) delta;
474 if (difference > 0) {
475 delay(difference);
476 }
477
478 lastDuration = delta;
479 }
480
481 int cycleCount = 0;
482
483 private void adjustRates() {
484
485 int addDelta = Math.max(1000 - cycleCount, 10);
486 double multRatio = Math.min(0.8 + cycleCount * 0.0002, 0.995);
487
488 //FIXME need to iron out the rate adjustment
489 //FIXME we should taper the adjustments over time
490 //FIXME don't just use the lastDuration, take an average
491 if (++cycleCount % 5 == 0) { //TODO: maybe use a timer (we should do this every 5-10 sec)
492 if (listener.requestThroughput() - listener.processedThroughput() <= 2000 && //was 500
493 lastDuration <= cyclePeriod) {
494 lastCount = Math.min(lastCount + addDelta, intents.size() / 2);
495 } else {
496 lastCount *= multRatio;
497 }
498 log.info("last count: {}, last duration: {} ms (sub: {} vs inst: {})",
499 lastCount, lastDuration, listener.requestThroughput(), listener.processedThroughput());
500 }
501
502 }
503 }
504
505 // Event listener to monitor throughput.
506 final class Listener implements IntentListener {
507
508 private final Counter runningTotal = new Counter();
509 private volatile Map<IntentEvent.Type, Counter> counters;
510
511 private volatile double processedThroughput = 0;
512 private volatile double requestThroughput = 0;
513
514 public Listener() {
515 counters = initCounters();
516 }
517
518 private Map<IntentEvent.Type, Counter> initCounters() {
519 Map<IntentEvent.Type, Counter> map = Maps.newHashMap();
520 for (IntentEvent.Type type : IntentEvent.Type.values()) {
521 map.put(type, new Counter());
522 }
523 return map;
524 }
525
526 public double processedThroughput() {
527 return processedThroughput;
528 }
529
530 public double requestThroughput() {
531 return requestThroughput;
532 }
533
534 @Override
535 public void event(IntentEvent event) {
536 if (event.subject().appId().equals(appId)) {
Yi Tseng356d1252017-05-25 16:01:58 -0700537 if (event.type() == INSTALLED) {
538 submitted.add(event.subject());
539 }
540 if (event.type() == WITHDRAWN) {
541 withdrawn.add(event.subject());
542 }
Brian O'Connora468e902015-03-18 16:43:49 -0700543 counters.get(event.type()).add(1);
544 }
545 }
546
547 public void report() {
548 Map<IntentEvent.Type, Counter> reportCounters = counters;
549 counters = initCounters();
550
551 // update running total and latest throughput
552 Counter installed = reportCounters.get(INSTALLED);
553 Counter withdrawn = reportCounters.get(WITHDRAWN);
554 processedThroughput = installed.throughput() + withdrawn.throughput();
555 runningTotal.add(installed.total() + withdrawn.total());
556
557 Counter installReq = reportCounters.get(INSTALL_REQ);
558 Counter withdrawReq = reportCounters.get(WITHDRAW_REQ);
559 requestThroughput = installReq.throughput() + withdrawReq.throughput();
560
561 // build the string to report
562 StringBuilder stringBuilder = new StringBuilder();
563 for (IntentEvent.Type type : IntentEvent.Type.values()) {
564 Counter counter = reportCounters.get(type);
565 stringBuilder.append(format("%s=%.2f;", type, counter.throughput()));
566 }
567 log.info("Throughput: OVERALL={}; CURRENT={}; {}",
568 format("%.2f", runningTotal.throughput()),
569 format("%.2f", processedThroughput),
570 stringBuilder);
571
572 sampleCollector.recordSample(runningTotal.throughput(),
573 processedThroughput);
574 }
575 }
576
Sho SHIMIZUc032c832016-01-13 13:02:05 -0800577 private class InternalControl implements Consumer<String> {
Brian O'Connora468e902015-03-18 16:43:49 -0700578 @Override
Sho SHIMIZUc032c832016-01-13 13:02:05 -0800579 public void accept(String cmd) {
Brian O'Connora468e902015-03-18 16:43:49 -0700580 log.info("Received command {}", cmd);
581 if (cmd.equals(START)) {
582 startTestRun();
583 } else {
584 stopTestRun();
585 }
586 }
587 }
588
589 private class ReporterTask extends TimerTask {
590 @Override
591 public void run() {
592 //adjustRates(); // FIXME we currently adjust rates in the cycle thread
593 listener.report();
594 }
595 }
596
597}