private List<UsageStatistic> retrieveMachineUsage(LocationUsage usage, Date startDate, Date endDate) { log.debug("Determining machine usage for location {}", usage.getLocationId()); log.trace("Considering machine usage events of {}: {}", usage.getLocationId(), usage.getEvents()); UsageStatistic statistic = new UsageStatistic(ApplicationTransformer.statusFromLifecycle(current.getState()), usage.getLocationId(), current.getApplicationId(), format(eventStartDate), format(eventEndDate), duration, usage.getMetadata()); log.trace("Adding machine usage statistic to response for app {}: {}", usage.getLocationId(), statistic); result.add(statistic);