All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.shoulder.monitor.concurrent.MonitorRunnableEnhancer Maven / Gradle / Ivy

Go to download

Shoulder 基础模块-监控能力,面向生产环境部署的应用,整合 Micrometer 提供运行监控能力,可与 Prometheus 轻易监控 Spring Boot 应用中线程池全面信息。

The newest version!
package org.shoulder.monitor.concurrent;

import org.shoulder.core.concurrent.enhance.EnhancedCallable;
import org.shoulder.core.concurrent.enhance.EnhancedRunnable;
import org.shoulder.core.concurrent.enhance.ThreadEnhancer;

/**
 * 自动统计在线程池队列内等待时间
 * @deprecated todo 规划后续实现中,暂不可用
 */
public class MonitorRunnableEnhancer implements ThreadEnhancer {

    /**
     * 包装 runnable
     *
     * @param runnable 包装前
     * @return 包装后
     */
    @Override
    public EnhancedRunnable doEnhance(EnhancedRunnable runnable) {
        return new DefaultMonitorableRunnable(runnable);
    }

    /**
     * 包装 callable
     *
     * @param callable 包装前
     * @param       泛型
     * @return 包装后
     */
    @Override
    public  EnhancedCallable doEnhance(EnhancedCallable callable) {
        return new DefaultMonitorableCallable<>(callable);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy