/** @param settingsP ... */ public RemoteControlPingLatencyExperiment(Settings settingsP) { this.settings = settingsP; loop = new ExperimentControlLoop(settingsP) { @Override protected void postInitialLoadCreated() { setUpRC(); } @Override protected void wrapupAndReport() { // CHECKSTYLE:OFF Histogram histogramSummary = new Histogram(TimeUnit.SECONDS.toNanos(10), 3); // CHECKSTYLE:ON for (LatencyMonitoringClient connection : clients) { histogramSummary.add(connection.getHistogram()); } histogramSummary .getHistogramData() .outputPercentileDistribution(getOutput(), 1, 1000.0); } }; loop.setClientFactory( new Factory<ExperimentClient>() { @Override public ExperimentClient create() { LatencyMonitoringClient pingClient = new PingClient( loop.getExperimentCounters(), settings.getMessageSize(), "DOMAIN/PING"); clients.add(pingClient); return pingClient; } @Override public void close() { for (LatencyMonitoringClient connection : clients) { connection.disconnect(); } } }); ExperimentLoadStrategy defaultLoadStrategy = new DefaultLoadStrategy(loop.getClientSettings(), loop.getExperimentCounters()); loop.setLoadStartegy(defaultLoadStrategy); }
@Override public void run() { loop.run(); }