@RequestMapping(value = "/stats", method = RequestMethod.GET, produces = "application/json") public RestEntity loadModel() throws RestException { List<AggregationResult> stats = StatisticsMonitor.getAggregationResults(); List<Statistic> mappedStats = new LinkedList<>(); for(AggregationResult stat : stats) { mappedStats.add(new Statistic(stat.getName(), stat.getAverage(), stat.getCalls(), stat.getTotalTime(), stat.getLowest(), stat.getHighest())); } return new StatisticCollection(mappedStats); }