class Execution implements AutoCloseable {

    public Map<String, Object> createReport() {

        // let's keep order of insertion consistent so that the report is easily
        // printable
        Map<String, Object> report = new LinkedHashMap<>();

        if (name != null) {
            report.put("Task", name);
        }

        for (Entry<String, ?> p : parameters.entrySet()) {
            report.put("Parameter[" + p.getKey() + "]", p.getValue());
        }

        DateFormat format = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");

        if (stats.isStopped()) {
            report.put("Status", "finished");
            report.put("Duration", stats.getDuration());
        } else {
            report.put("Status", "in progress");
            report.put("Started on ", format.format(new Date(stats.getStarted())));
        }

        report.put("Extracted", stats.getExtracted());
        report.put("Created", stats.getCreated());
        report.put("Updated", stats.getUpdated());
        report.put("Deleted", stats.getDeleted());

        return report;
    }

    public  Execution(String name, Map<String, ?> params);

}