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

com.github.trang.druid.actuate.DruidDataSourceEndpoint Maven / Gradle / Ivy

There is a newer version: 1.1.10.2
Show newest version
package com.github.trang.druid.actuate;

import java.util.List;
import java.util.Map;

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.context.properties.ConfigurationProperties;

import com.alibaba.druid.stat.DruidStatManagerFacade;

/**
 * 将 Druid 的信息暴露出来
 *
 * @author trang
 */
@ConfigurationProperties(prefix = "endpoints.druid")
@Endpoint(id = "druid")
public class DruidDataSourceEndpoint {

    private static final DruidStatManagerFacade STAT_MANAGER = DruidStatManagerFacade.getInstance();

    @ReadOperation
    public List> invoke() {
        return STAT_MANAGER.getDataSourceStatDataList();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy