public void benchmarkPushStrategy() throws Exception
{
InetSocketAddress address = startHTTPServer(version, new PushStrategyBenchmarkHandler(), 30000);
// Plain HTTP
ConnectionFactory factory = new HttpConnectionFactory(new HttpConfiguration());
connector.setDefaultProtocol(factory.getProtocol());
HttpClient httpClient = new HttpClient();
// Simulate browsers, that open 6 connection per origin
httpClient.setMaxConnectionsPerDestination(6);
httpClient.start();
benchmarkHTTP(httpClient);
httpClient.stop();
// First push strategy
PushStrategy pushStrategy = new PushStrategy.None();
factory = new HTTPSPDYServerConnectionFactory(version, new HttpConfiguration(), pushStrategy);
connector.setDefaultProtocol(factory.getProtocol());
Session session = startClient(version, address, new ClientSessionFrameListener());
benchmarkSPDY(pushStrategy, session);
session.goAway(new GoAwayInfo(5, TimeUnit.SECONDS));
// Second push strategy
pushStrategy = new ReferrerPushStrategy();
factory = new HTTPSPDYServerConnectionFactory(version, new HttpConfiguration(), pushStrategy);
connector.setDefaultProtocol(factory.getProtocol());
session = startClient(version, address, new ClientSessionFrameListener());
benchmarkSPDY(pushStrategy, session);
session.goAway(new GoAwayInfo(5, TimeUnit.SECONDS));
}