presto-main/src/main/java/io/prestosql/sql/planner/RuleStatsRecorder.java/RuleStatsRecorder/export
class RuleStatsRecorder:    synchronized void export(MBeanExporter exporter)
    {
        checkState(mbeanExports.isEmpty(), "MBeans already exported");
        for (Map.Entry<Class<?>, RuleStats> entry : stats.entrySet()) {
            verify(!entry.getKey().getSimpleName().isEmpty());
            try {
                mbeanExports.add(exporter.exportWithGeneratedName(entry.getValue(), IterativeOptimizer.class, ImmutableMap.<String, String>builder()
                        .put("name", IterativeOptimizer.class.getSimpleName())
                        .put("rule", entry.getKey().getSimpleName())
                        .build()));
            }
            catch (RuntimeException e) {
                throw new RuntimeException(format("Failed to export MBean with for rule '%s'", entry.getKey().getSimpleName()), e);
            }
        }
    }