提交 6f1b4e87 编写于 作者: Y Yiming Liu

Merge branch 'master' of ssh://192.168.8.22:58422/cat

......@@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.dianping.bee</groupId>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-consumer</artifactId>
......@@ -30,116 +30,28 @@
<plugin>
<groupId>org.unidal.maven.plugins</groupId>
<artifactId>codegen-maven-plugin</artifactId>
<version>1.1.5</version>
<version>1.1.6</version>
<executions>
<execution>
<id>generate database report model</id>
<id>generate report models</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/database-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate sql report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/sql-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate month report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/month-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate common report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/common-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate cross report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/cross-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate matrix report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/matrix-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate heartbeat report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/heartbeat-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate problem report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/problem-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate transaction report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/transaction-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate event report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/event-report-manifest.xml</manifest>
</configuration>
</execution>
<execution>
<id>generate IP report model</id>
<phase>generate-sources</phase>
<goals>
<goal>dal-model</goal>
</goals>
<configuration>
<manifest>${basedir}/src/main/resources/META-INF/dal/model/ip-report-manifest.xml</manifest>
<manifest>
${basedir}/src/main/resources/META-INF/dal/model/database-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/sql-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/month-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/common-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/cross-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/matrix-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/heartbeat-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/problem-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/transaction-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/event-report-manifest.xml,
${basedir}/src/main/resources/META-INF/dal/model/ip-report-manifest.xml,
</manifest>
</configuration>
</execution>
<execution>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-core</artifactId>
......
......@@ -36,6 +36,10 @@ public class ClientConfigManager implements LogEnabled {
}
}
public ClientConfig getClientConfig() {
return m_config;
}
public Domain getFirstDomain() {
if (m_config == null) {
return new Domain("UNKNOWN").setEnabled(false);
......@@ -54,10 +58,6 @@ public class ClientConfigManager implements LogEnabled {
return m_config.getServers();
}
}
public ClientConfig getClientConfig(){
return m_config;
}
public void initialize(File configFile) throws Exception {
ClientConfig globalConfig = null;
......@@ -117,8 +117,15 @@ public class ClientConfigManager implements LogEnabled {
}
}
public boolean isDumpLocked() {
if (m_config == null) {
return false;
} else {
return m_config.isDumpLocked();
}
}
public boolean isInitialized() {
return m_config != null;
}
}
......@@ -27,6 +27,8 @@ import com.dianping.cat.status.model.transform.BaseVisitor;
class StatusInfoCollector extends BaseVisitor {
private MessageStatistics m_statistics;
private boolean m_dumpLocked;
public StatusInfoCollector(MessageStatistics statistics) {
m_statistics = statistics;
}
......@@ -94,6 +96,11 @@ class StatusInfoCollector extends BaseVisitor {
return isInstanceOfInterface(clazz.getSuperclass(), interfaceName);
}
public StatusInfoCollector setDumpLocked(boolean dumpLocked) {
m_dumpLocked = dumpLocked;
return this;
}
@Override
public void visitDisk(DiskInfo disk) {
File[] roots = File.listRoots();
......@@ -205,15 +212,23 @@ class StatusInfoCollector extends BaseVisitor {
@Override
public void visitThread(ThreadsInfo thread) {
ThreadMXBean bean = ManagementFactory.getThreadMXBean();
ThreadInfo[] threads = bean.dumpAllThreads(true, true);
bean.setThreadContentionMonitoringEnabled(true);
ThreadInfo[] threads;
if (m_dumpLocked) {
threads = bean.dumpAllThreads(true, true);
} else {
threads = bean.dumpAllThreads(false, false);
}
thread.setCount(bean.getThreadCount());
thread.setDaemonCount(bean.getDaemonThreadCount());
thread.setPeekCount(bean.getPeakThreadCount());
thread.setTotalStartedCount((int) bean.getTotalStartedThreadCount());
thread.setCatThreadCount(countThreadsByPrefix(threads, "Cat-"));
thread.setPigeonThreadCount(countThreadsByPrefix(threads, "Pigeon-", "DPSF-", "Netty-",
"Client-ResponseProcessor"));
thread.setPigeonThreadCount(countThreadsByPrefix(threads, "Pigeon-", "DPSF-", "Netty-", "Client-ResponseProcessor"));
int jbossThreadsCount = countThreadsByPrefix(threads, "http-");
int jettyThreadsCount = countThreadsBySubstring(threads, "@qtp");
......
......@@ -21,7 +21,7 @@ import com.site.lookup.annotation.Inject;
public class StatusUpdateTask implements Task, Initializable {
@Inject
private MessageStatistics m_statistics;
@Inject
private ClientConfigManager m_manager;
......@@ -69,23 +69,26 @@ public class StatusUpdateTask implements Task, Initializable {
while (m_active) {
long start = MilliSecondTimer.currentTimeMillis();
if (m_manager.isCatEnabled()) {
Transaction t = cat.newTransaction("System", "Status");
Heartbeat h = cat.newHeartbeat("Heartbeat", m_ipAddress);
StatusInfo status = new StatusInfo();
try {
status.accept(new StatusInfoCollector(m_statistics));
h.addData(status.toString());
h.setStatus(Message.SUCCESS);
} catch (Throwable e) {
h.setStatus(e);
cat.logError(e);
} finally {
h.complete();
}
t.setStatus(Message.SUCCESS);
t.complete();
}
Transaction t = cat.newTransaction("System", "Status");
Heartbeat h = cat.newHeartbeat("Heartbeat", m_ipAddress);
StatusInfo status = new StatusInfo();
t.addData("dumpLocked", m_manager.isDumpLocked());
try {
status.accept(new StatusInfoCollector(m_statistics).setDumpLocked(m_manager.isDumpLocked()));
h.addData(status.toString());
h.setStatus(Message.SUCCESS);
} catch (Throwable e) {
h.setStatus(e);
cat.logError(e);
} finally {
h.complete();
}
t.setStatus(Message.SUCCESS);
t.complete();
}
long elapsed = MilliSecondTimer.currentTimeMillis() - start;
if (elapsed < m_interval) {
......
......@@ -3,6 +3,7 @@
<entity name="config" root="true">
<attribute name="mode" value-type="String" />
<attribute name="enabled" value-type="boolean" />
<attribute name="dump-locked" value-type="boolean" />
<entity-ref name="server" type="list" names="servers" xml-indent="true" />
<entity-ref name="domain" type="list" names="domains" />
<entity-ref name="bind" />
......
......@@ -23,6 +23,7 @@
</xs:sequence>
<xs:attribute name="mode" type="xs:string" use="required"/>
<xs:attribute name="enabled" type="xs:boolean" default="true"/>
<xs:attribute name="dump-locked" type="xs:boolean"/>
<xs:anyAttribute processContents="lax"/>
</xs:complexType>
<xs:complexType name="ServerType">
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-data</artifactId>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-hadoop</artifactId>
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-home</artifactId>
......
......@@ -26,6 +26,7 @@ Welcome to <b>Central Application Tracking (CAT)</b>.
<br>
<table class='version'>
<tr class="odd"><td>版本</td><td>说明</td><td>发布时间</td></tr>
<tr class="even"><td>0.4.1</td><td>1、默认禁止心跳线程获取线程锁信息,以降低对业务线程的影响。</td><td>2012-09-06</td></tr>
<tr class="even"><td>0.4.0</td><td>1、支持开关动态关闭。2、支持分布式Logview的查看(关联pigeon的call)。</td><td>2012-08-20</td></tr>
<tr class="odd"><td>0.3.4</td><td>1、规范了CAT客户端的日志。2、规范了后台模块的加载顺序。3、统一服务端配置存取。4、新增心跳报表的Http线程 </td><td>2012-07-25</td></tr>
<tr class="even"><td>0.3.3</td><td>1、修改CAT线程为后台Dameon线程。2、减少CAT的日志输出。3、修复了极端情况客户端丢失部分消息。4、支持CAT的延迟加载。5、修复了0.3.2一个getLog的bug</td><td>2012-07-17</td></tr>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cat-job</artifactId>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<inceptionYear>2012</inceptionYear>
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dog-gateway</artifactId>
......
......@@ -3,7 +3,7 @@
<parent>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dog-home</artifactId>
......
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.dianping.cat</groupId>
<artifactId>parent</artifactId>
<version>0.4.1</version>
<version>0.4.2</version>
<name>arch-cat</name>
<description>Central Application Tracking</description>
<packaging>pom</packaging>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册