[유치수] [NOBTS] 서버맵에서 hostname조회 개선. agentinfo는 ip와 hostname을 수집하고 view에서는 hostname을 조회해서 보여준다.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@1340 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Chisu Yu
2013-03-18 07:13:30 +00:00
parent 36c395ec1a
commit 2d6ae2faec
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -15,7 +15,8 @@ profile.jdbc.dbcp=true
profile.jvm.collect.interval=1000
#web view 테스트용. 나중에 필요하면 정규식형태로 바꿔도 되고 필요 없으면 삭제.
profile.include=com.nhn.hippo.testweb.controller.*,com.nhn.hippo.testweb.repository.*,com.nhn.hippo.testweb.util.HttpInvoker
#profile.include=com.nhn.hippo.testweb.controller.*,com.nhn.hippo.testweb.repository.*,com.nhn.hippo.testweb.util.HttpInvoker
profile.include=com.nhn.hippo.testweb.controller.*
#timebase 샘플링을 할지 말지 여부 결정.
sampling.elapsedtimebase.enable=true
+4 -2
View File
@@ -32,6 +32,7 @@ public class Agent implements Runnable {
private DataSender priorityDataSender;
private DataSender dataSender;
private final String machineName;
private final String agentId;
private final String nodeName;
private final String applicationName;
@@ -83,7 +84,7 @@ public class Agent implements Runnable {
// TODO 일단 임시로 호환성을 위해 agentid에 machinename을 넣도록 하자
// TODO 박스 하나에 서버 인스턴스를 여러개 실행할 때에 문제가 될 수 있음.
String machineName = NetworkUtils.getMachineName();
this.machineName = NetworkUtils.getMachineName();
this.agentId = getId("hippo.agentId", machineName, HBaseTables.AGENT_NAME_MAX_LEN);
this.nodeName = System.getProperty("hippo.nodeName", machineName);
this.applicationName = getId("hippo.applicationName", "UnknownApplicationName", HBaseTables.APPLICATION_NAME_MAX_LEN);
@@ -124,7 +125,8 @@ public class Agent implements Runnable {
AgentInfo agentInfo = new AgentInfo();
agentInfo.setHostname(ip);
agentInfo.setIp(ip);
agentInfo.setHostname(this.machineName);
agentInfo.setPorts(ports);
agentInfo.setAgentId(getAgentId());