// Path: src/main/java/com/cscotta/deschutes/api/ConcurrentRollup.java
// public interface ConcurrentRollup<Input> extends Event {
// 
//     /**
//      * <p>Rollup method called as events are received by a stream for
//      * aggregation.</p>
//      *
//      * <p>Implementations of ConcurrentRollup should accept {@link Event}s, maintain
//      * the aggregations desired (sums, averages, histograms, and so on), and expose
//      * them for downstream {@link OutputListener}s to access as output. See the
//      * {@link ConcurrentRollup} documentation above for a sample implementation.</p>
//      *
//      * @param input An event received by a stream to be rolled up.
//      */
//     public abstract void rollup(Input input);
// 
//     public long getTimestamp();
// }
// 
// Path: src/main/java/com/cscotta/deschutes/api/RollupFactory.java
// public interface RollupFactory<T> {
// 
//     public ConcurrentRollup<T> buildRollup(long timestamp);
// 
// }
// 
// Path: src/main/java/com/cscotta/deschutes/example/requests/RequestRollup.java
// public class RequestRollup implements ConcurrentRollup<RequestEvent> {
// 
//     private final long timestamp;
// 
//     public RequestRollup(long timestamp) {
//         this.timestamp = timestamp;
//     }
// 
//     private final AtomicLong requestCount = new AtomicLong(0);
//     private final AtomicLong totalRequestBytes = new AtomicLong(0);
//     private final AtomicLong totalResponseBytes = new AtomicLong(0);
// 
//     private final Histogram requestBytesHisto = new Histogram(new UniformReservoir());
//     private final Histogram responseBytesHisto = new Histogram(new UniformReservoir());
// 
//     private final Histogram handshakeUsec = new Histogram(new UniformReservoir());
//     private final Histogram usecToFirstByte = new Histogram(new UniformReservoir());
//     private final Histogram usecTotal = new Histogram(new UniformReservoir());
// 
// 
//     public long getRequestCount() { return requestCount.get(); }
//     public long getTotalRequestBytes() { return totalRequestBytes.get(); }
//     public long getTotalResponseBytes() { return totalResponseBytes.get(); }
// 
//     public Snapshot getRequestBytesHisto() { return requestBytesHisto.getSnapshot(); }
//     public Snapshot getResponseBytesHisto() { return responseBytesHisto.getSnapshot(); }
// 
//     public Snapshot getHandshakeUsecHisto() { return handshakeUsec.getSnapshot(); }
//     public Snapshot getUsecToFirstByteHisto() { return usecToFirstByte.getSnapshot(); }
//     public Snapshot getUsecTotalHisto() { return usecTotal.getSnapshot(); }
// 
//     @Override
//     public void rollup(RequestEvent request) {
//         requestCount.incrementAndGet();
//         totalRequestBytes.addAndGet(request.getRequestBytes());
//         totalResponseBytes.addAndGet(request.getResponseBytes());
//         requestBytesHisto.update(request.getRequestBytes());
//         responseBytesHisto.update(request.getResponseBytes());
//         handshakeUsec.update(request.getHandshakeUsec());
//         usecToFirstByte.update(request.getUsecToFirstByte());
//         usecTotal.update(request.getUsecTotal());
//     }
// 
//     @Override
//     public long getTimestamp() {
//         return this.timestamp;
//     }
// }
// 
// Path: src/main/java/com/cscotta/deschutes/example/requests/RequestEvent.java
// public class RequestEvent implements Event {
// 
//     private final Request request;
// 
//     public RequestEvent(Request request) {
//        this.request = request;
//     }
// 
//     @Override
//     public long getTimestamp() {
//         return request.getTimestamp();
//     }
// 
//     public int getUserId() {
//         return request.getUserId();
//     }
// 
//     public int getClientIp() {
//         return request.getClientIp();
//     }
// 
//     public int getServerIp() {
//         return request.getServerIp();
//     }
// 
//     public OperationType getOperationType() {
//         return request.getOperationType();
//     }
// 
//     public Protocol getProtocol() {
//         return request.getProtocol();
//     }
// 
//     public int getResponseCode() {
//         return request.getResponseCode();
//     }
// 
//     public String getUri() {
//         return request.getUri();
//     }
// 
//     public int getRequestBytes() {
//         return request.getRequestBytes();
//     }
// 
//     public int getResponseBytes() {
//         return request.getResponseBytes();
//     }
// 
//     public long getHandshakeUsec() {
//         return request.getHandshakeUsec();
//     }
// 
//     public long getUsecToFirstByte() {
//         return request.getUsecToFirstByte();
//     }
// 
//     public long getUsecTotal() {
//         return request.getUsecTotal();
//     }
// 
//     public String getUserAgent() {
//         return request.getUserAgent();
//     }
// 
//     public String getLocale() {
//         return request.getLocale();
//     }
// 
//     public String getReferrer() {
//         return request.getReferrer();
//     }
// 
//     @Override
//     public String toString() {
//         return request.toString();
//     }
// 
// }


import com.cscotta.deschutes.api.ConcurrentRollup;
import com.cscotta.deschutes.api.RollupFactory;
import com.cscotta.deschutes.example.requests.RequestRollup;
import com.cscotta.deschutes.example.requests.RequestEvent;
package com.cscotta.deschutes.example.requests;


public class RequestRollups {

    public static final RollupFactory<RequestEvent> collapser = new RollupFactory<RequestEvent>() {
        @Override
// Path: src/main/java/com/cscotta/deschutes/api/ConcurrentRollup.java
// public interface ConcurrentRollup<Input> extends Event {
// 
//     /**
//      * <p>Rollup method called as events are received by a stream for
//      * aggregation.</p>
//      *
//      * <p>Implementations of ConcurrentRollup should accept {@link Event}s, maintain
//      * the aggregations desired (sums, averages, histograms, and so on), and expose
//      * them for downstream {@link OutputListener}s to access as output. See the
//      * {@link ConcurrentRollup} documentation above for a sample implementation.</p>
//      *
//      * @param input An event received by a stream to be rolled up.
//      */
//     public abstract void rollup(Input input);
// 
//     public long getTimestamp();
// }
// 
// Path: src/main/java/com/cscotta/deschutes/api/RollupFactory.java
// public interface RollupFactory<T> {
// 
//     public ConcurrentRollup<T> buildRollup(long timestamp);
// 
// }
// 
// Path: src/main/java/com/cscotta/deschutes/example/requests/RequestRollup.java
// public class RequestRollup implements ConcurrentRollup<RequestEvent> {
// 
//     private final long timestamp;
// 
//     public RequestRollup(long timestamp) {
//         this.timestamp = timestamp;
//     }
// 
//     private final AtomicLong requestCount = new AtomicLong(0);
//     private final AtomicLong totalRequestBytes = new AtomicLong(0);
//     private final AtomicLong totalResponseBytes = new AtomicLong(0);
// 
//     private final Histogram requestBytesHisto = new Histogram(new UniformReservoir());
//     private final Histogram responseBytesHisto = new Histogram(new UniformReservoir());
// 
//     private final Histogram handshakeUsec = new Histogram(new UniformReservoir());
//     private final Histogram usecToFirstByte = new Histogram(new UniformReservoir());
//     private final Histogram usecTotal = new Histogram(new UniformReservoir());
// 
// 
//     public long getRequestCount() { return requestCount.get(); }
//     public long getTotalRequestBytes() { return totalRequestBytes.get(); }
//     public long getTotalResponseBytes() { return totalResponseBytes.get(); }
// 
//     public Snapshot getRequestBytesHisto() { return requestBytesHisto.getSnapshot(); }
//     public Snapshot getResponseBytesHisto() { return responseBytesHisto.getSnapshot(); }
// 
//     public Snapshot getHandshakeUsecHisto() { return handshakeUsec.getSnapshot(); }
//     public Snapshot getUsecToFirstByteHisto() { return usecToFirstByte.getSnapshot(); }
//     public Snapshot getUsecTotalHisto() { return usecTotal.getSnapshot(); }
// 
//     @Override
//     public void rollup(RequestEvent request) {
//         requestCount.incrementAndGet();
//         totalRequestBytes.addAndGet(request.getRequestBytes());
//         totalResponseBytes.addAndGet(request.getResponseBytes());
//         requestBytesHisto.update(request.getRequestBytes());
//         responseBytesHisto.update(request.getResponseBytes());
//         handshakeUsec.update(request.getHandshakeUsec());
//         usecToFirstByte.update(request.getUsecToFirstByte());
//         usecTotal.update(request.getUsecTotal());
//     }
// 
//     @Override
//     public long getTimestamp() {
//         return this.timestamp;
//     }
// }
// 
// Path: src/main/java/com/cscotta/deschutes/example/requests/RequestEvent.java
// public class RequestEvent implements Event {
// 
//     private final Request request;
// 
//     public RequestEvent(Request request) {
//        this.request = request;
//     }
// 
//     @Override
//     public long getTimestamp() {
//         return request.getTimestamp();
//     }
// 
//     public int getUserId() {
//         return request.getUserId();
//     }
// 
//     public int getClientIp() {
//         return request.getClientIp();
//     }
// 
//     public int getServerIp() {
//         return request.getServerIp();
//     }
// 
//     public OperationType getOperationType() {
//         return request.getOperationType();
//     }
// 
//     public Protocol getProtocol() {
//         return request.getProtocol();
//     }
// 
//     public int getResponseCode() {
//         return request.getResponseCode();
//     }
// 
//     public String getUri() {
//         return request.getUri();
//     }
// 
//     public int getRequestBytes() {
//         return request.getRequestBytes();
//     }
// 
//     public int getResponseBytes() {
//         return request.getResponseBytes();
//     }
// 
//     public long getHandshakeUsec() {
//         return request.getHandshakeUsec();
//     }
// 
//     public long getUsecToFirstByte() {
//         return request.getUsecToFirstByte();
//     }
// 
//     public long getUsecTotal() {
//         return request.getUsecTotal();
//     }
// 
//     public String getUserAgent() {
//         return request.getUserAgent();
//     }
// 
//     public String getLocale() {
//         return request.getLocale();
//     }
// 
//     public String getReferrer() {
//         return request.getReferrer();
//     }
// 
//     @Override
//     public String toString() {
//         return request.toString();
//     }
// 
// }


// Path: src/main/java/com/cscotta/deschutes/example/requests/RequestRollups.java
import com.cscotta.deschutes.api.ConcurrentRollup;
import com.cscotta.deschutes.api.RollupFactory;
import com.cscotta.deschutes.example.requests.RequestRollup;
import com.cscotta.deschutes.example.requests.RequestEvent;

package com.cscotta.deschutes.example.requests;


public class RequestRollups {

    public static final RollupFactory<RequestEvent> collapser = new RollupFactory<RequestEvent>() {
        @Override
        public ConcurrentRollup<RequestEvent> buildRollup(long timestamp) {