class JvmCompilationMetrics {

    private static final String JVM_COMPILATION_TIME_SECONDS_TOTAL = "jvm_compilation_time_seconds_total";

    private final PrometheusProperties config;
    private final CompilationMXBean compilationBean;

    private JvmCompilationMetrics(CompilationMXBean compilationBean, PrometheusProperties config) {
        this.compilationBean = compilationBean;
        this.config = config;
    }

    private void register(PrometheusRegistry registry) {<FILL_FUNCTION_BODY>}

    public static Builder builder() {
        return new Builder(PrometheusProperties.get());
    }

    public static Builder builder(PrometheusProperties config) {
        return new Builder(config);
    }

    public static class Builder {

        private final PrometheusProperties config;
        private CompilationMXBean compilationBean;

        private Builder(PrometheusProperties config) {
            this.config = config;
        }

        /**
         * Package private. For testing only.
         */
        Builder compilationBean(CompilationMXBean compilationBean) {
            this.compilationBean = compilationBean;
            return this;
        }

        public void register() {
            register(PrometheusRegistry.defaultRegistry);
        }

        public void register(PrometheusRegistry registry) {
            CompilationMXBean compilationBean = this.compilationBean != null ? this.compilationBean : ManagementFactory.getCompilationMXBean();
            new JvmCompilationMetrics(compilationBean, config).register(registry);
        }
    }
}


        if (compilationBean == null || !compilationBean.isCompilationTimeMonitoringSupported()) {
            return;
        }

        CounterWithCallback.builder(config)
                .name(JVM_COMPILATION_TIME_SECONDS_TOTAL)
                .help("The total time in seconds taken for HotSpot class compilation")
                .unit(Unit.SECONDS)
                .callback(callback -> callback.call(millisToSeconds(compilationBean.getTotalCompilationTime())))
                .register(registry);
    
<no_super_class>