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