public Statistics(CrawlSession session, StateStatistics stateStats, Date startDate,
int failedEvents) {
this.stateStats = stateStats;
this.failedEvents = failedEvents;
this.startDate = new Date(startDate.getTime());
StateFlowGraph stateFlowGraph = session.getStateFlowGraph();
this.duration = calculateDuration(session);
this.edges = stateFlowGraph.getAllEdges().size();
this.crawlPaths = session.getCrawlPaths().size();
double bytes = stateFlowGraph.getMeanStateStringSize();
this.averageDomSize = new DecimalFormat().format(bytes / 1000) + " kB";
}