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

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

Go to download

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

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

/**
 * 可监控的任务
 * 任务(Runnable)为监控指标添加(任务名)标签
 *
 * @author lym
 */
public interface MonitorableRunnable {

    /**
     * 任务名称,设置后可以分任务监控
     *
     * @return 任务名称,默认返回类名
     */
    default String getTaskName() {
        return this.getClass().getSimpleName();
    }

    /**
     * 跟踪任务id
     */
    String getRunnableId();

    /**
     * 跟踪进、出队列时间
     */
    void setEnqueueTime(long enqueueTime);

    long getEnqueueTime();

    long getWaitInQueueDuration();
    void setWaitInQueueDuration(long enqueueTime);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy