Search in sources :

Example 1 with SqlDetailResult

use of com.alibaba.druid.admin.model.dto.SqlDetailResult in project druid by alibaba.

the class MonitorStatService method getSqlStat.

/**
 * 获取sql详情
 *
 * @param id
 * @param serviceId consul获取的服务id
 * @return
 */
private String getSqlStat(Integer id, String serviceId) {
    log.info("serviceId:{}", serviceId);
    ServiceNode serviceNode = serviceIdMap.get(serviceId);
    String url = "http://" + serviceNode.getAddress() + ":" + serviceNode.getPort() + "/druid/sql-" + id + ".json";
    SqlDetailResult sqlDetailResult = HttpUtil.get(url, SqlDetailResult.class);
    return JSON.toJSONString(sqlDetailResult);
}
Also used : ServiceNode(com.alibaba.druid.admin.model.ServiceNode) SqlDetailResult(com.alibaba.druid.admin.model.dto.SqlDetailResult)

Aggregations

ServiceNode (com.alibaba.druid.admin.model.ServiceNode)1 SqlDetailResult (com.alibaba.druid.admin.model.dto.SqlDetailResult)1