class SystemMetricManager {

    private static final CpuMetricsCaptor CPU_METRICS_CAPTOR;

    private static final MemoryMetricsCaptor MEMORY_METRICS_CAPTOR;

    private static final ScheduledExecutorService EXECUTOR = ThreadPoolCreator.newScheduledThreadPool("dtp-system-metric", 1);

    static {
        CPU_METRICS_CAPTOR = new CpuMetricsCaptor();
        MEMORY_METRICS_CAPTOR = new MemoryMetricsCaptor();
        EXECUTOR.scheduleAtFixedRate(CPU_METRICS_CAPTOR, 0, 2, TimeUnit.SECONDS);
        EXECUTOR.scheduleAtFixedRate(MEMORY_METRICS_CAPTOR, 0, 2, TimeUnit.SECONDS);
    }

    public static String getSystemMetric() {<FILL_FUNCTION_BODY>}

    public static double getProcessCpuUsage() {
        return CPU_METRICS_CAPTOR.getProcessCpuUsage();
    }

    public static double getLongLivedMemoryUsage() {
        return MEMORY_METRICS_CAPTOR.getLongLivedMemoryUsage();
    }

    public static void stop() {
        EXECUTOR.shutdown();
    }
}

        OperatingSystemMXBean osBean = ManagementFactory.getPlatformMXBean(OperatingSystemMXBean.class);
        double systemAvgLoad = osBean.getSystemLoadAverage();
        double systemCpuUsage = OperatingSystemBeanManager.getSystemCpuUsage();
        int cpuCores = osBean.getAvailableProcessors();
        return String.format("SystemMetric{sAvgLoad=%.2f, sCpuUsage=%.2f, pCpuUsage=%.2f, cpuCores=%d, oldMemUsage=%.2f}",
                systemAvgLoad, systemCpuUsage, getProcessCpuUsage(), cpuCores, getLongLivedMemoryUsage());
    
<no_super_class>