Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
1b5fd6af
C
cat
项目概览
梦中观雨
/
cat
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1b5fd6af
编写于
8月 30, 2012
作者:
Y
youyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the cat dump
上级
ae808c9b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
35 deletion
+22
-35
cat-consumer/src/main/java/com/dianping/cat/consumer/dump/DumpAnalyzer.java
...ain/java/com/dianping/cat/consumer/dump/DumpAnalyzer.java
+7
-6
cat-consumer/src/main/java/com/dianping/cat/consumer/dump/DumpChannel.java
...main/java/com/dianping/cat/consumer/dump/DumpChannel.java
+0
-18
cat-core/src/main/java/com/dianping/cat/storage/dump/DumpItem.java
...src/main/java/com/dianping/cat/storage/dump/DumpItem.java
+4
-4
cat-core/src/main/java/com/dianping/cat/storage/dump/LocalMessageBucketManager.java
.../dianping/cat/storage/dump/LocalMessageBucketManager.java
+6
-4
cat-home/src/main/webapp/jsp/report/home.jsp
cat-home/src/main/webapp/jsp/report/home.jsp
+5
-3
未找到文件。
cat-consumer/src/main/java/com/dianping/cat/consumer/dump/DumpAnalyzer.java
浏览文件 @
1b5fd6af
...
...
@@ -20,7 +20,7 @@ import com.dianping.cat.message.internal.MessageId;
import
com.dianping.cat.message.spi.AbstractMessageAnalyzer
;
import
com.dianping.cat.message.spi.MessagePathBuilder
;
import
com.dianping.cat.message.spi.MessageTree
;
import
com.dianping.cat.storage.dump.Dump
Tree
Item
;
import
com.dianping.cat.storage.dump.DumpItem
;
import
com.dianping.cat.storage.dump.LocalMessageBucketManager
;
import
com.dianping.cat.storage.dump.MessageBucketManager
;
import
com.site.helper.Threads
;
...
...
@@ -47,7 +47,7 @@ public class DumpAnalyzer extends AbstractMessageAnalyzer<Object> implements Ini
private
Logger
m_logger
;
private
final
BlockingQueue
<
Dump
TreeItem
>
m_queue
=
new
LinkedBlockingQueue
<
DumpTree
Item
>(
10000
);
private
final
BlockingQueue
<
Dump
Item
>
m_storeQueue
=
new
LinkedBlockingQueue
<
Dump
Item
>(
10000
);
private
int
m_errors
;
...
...
@@ -122,8 +122,9 @@ public class DumpAnalyzer extends AbstractMessageAnalyzer<Object> implements Ini
}
}
else
{
try
{
DumpTreeItem
item
=
m_bucketManager
.
getStoreMeta
(
tree
);
boolean
result
=
m_queue
.
offer
(
item
);
DumpItem
item
=
m_bucketManager
.
buildStoreMetaInfo
(
tree
);
boolean
result
=
m_storeQueue
.
offer
(
item
);
if
(!
result
)
{
m_errors
++;
...
...
@@ -131,7 +132,7 @@ public class DumpAnalyzer extends AbstractMessageAnalyzer<Object> implements Ini
m_logger
.
error
(
"Error when put dump item into queue, errors:"
+
m_errors
);
}
}
//
m_bucketManager.storeMessage(tree);
//m_bucketManager.storeMessage(tree);
}
catch
(
IOException
e
)
{
m_logger
.
error
(
"Error when dumping to local file system!"
,
e
);
}
...
...
@@ -164,7 +165,7 @@ public class DumpAnalyzer extends AbstractMessageAnalyzer<Object> implements Ini
// long current = System.currentTimeMillis();
while
(
true
)
{
try
{
Dump
TreeItem
item
=
m_q
ueue
.
poll
(
5
,
TimeUnit
.
MILLISECONDS
);
Dump
Item
item
=
m_storeQ
ueue
.
poll
(
5
,
TimeUnit
.
MILLISECONDS
);
if
(
item
!=
null
)
{
m_bucketManager
.
storeMessage
(
item
);
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/dump/DumpChannel.java
浏览文件 @
1b5fd6af
...
...
@@ -75,24 +75,6 @@ public class DumpChannel {
m_lastChunkAdjust
=
lastChunkAdjust
;
}
public
int
write
(
ChannelBuffer
buf
)
throws
IOException
{
int
length
=
buf
.
readInt
();
long
count
=
m_file
.
length
();
if
(
m_maxSize
>
0
&&
count
+
m_lastChunkAdjust
+
length
>
m_maxSize
)
{
// exceed the max size
return
0
;
}
buf
.
getBytes
(
buf
.
readerIndex
(),
m_out
,
length
);
// a blank line used to separate two message trees
m_out
.
write
(
'\n'
);
//m_out.flush();
return
length
+
1
;
}
public
int
write
(
MessageTree
tree
)
throws
IOException
{
ChannelBuffer
buf
=
ChannelBuffers
.
dynamicBuffer
(
8192
);
...
...
cat-core/src/main/java/com/dianping/cat/storage/dump/Dump
Tree
Item.java
→
cat-core/src/main/java/com/dianping/cat/storage/dump/DumpItem.java
浏览文件 @
1b5fd6af
package
com.dianping.cat.storage.dump
;
public
class
Dump
Tree
Item
{
public
class
DumpItem
{
private
int
m_index
;
...
...
@@ -15,7 +15,7 @@ public class DumpTreeItem {
return
m_index
;
}
public
Dump
Tree
Item
setIndex
(
int
index
)
{
public
DumpItem
setIndex
(
int
index
)
{
m_index
=
index
;
return
this
;
}
...
...
@@ -24,7 +24,7 @@ public class DumpTreeItem {
return
m_fileName
;
}
public
Dump
Tree
Item
setFileName
(
String
fileName
)
{
public
DumpItem
setFileName
(
String
fileName
)
{
m_fileName
=
fileName
;
return
this
;
}
...
...
@@ -33,7 +33,7 @@ public class DumpTreeItem {
return
m_size
;
}
public
Dump
Tree
Item
setSize
(
int
size
)
{
public
DumpItem
setSize
(
int
size
)
{
m_size
=
size
;
return
this
;
}
...
...
cat-core/src/main/java/com/dianping/cat/storage/dump/LocalMessageBucketManager.java
浏览文件 @
1b5fd6af
...
...
@@ -168,8 +168,8 @@ public class LocalMessageBucketManager extends ContainerHolder implements Messag
m_baseDir
=
baseDir
;
}
public
Dump
TreeItem
getStoreMeta
(
MessageTree
tree
)
throws
IOException
{
Dump
TreeItem
item
=
new
DumpTree
Item
();
public
Dump
Item
buildStoreMetaInfo
(
MessageTree
tree
)
throws
IOException
{
Dump
Item
item
=
new
Dump
Item
();
MessageId
messageId
=
MessageId
.
parse
(
tree
.
getMessageId
());
int
index
=
messageId
.
getIndex
();
...
...
@@ -206,12 +206,14 @@ public class LocalMessageBucketManager extends ContainerHolder implements Messag
private
ChannelBuffer
getChannelBuf
(
int
index
,
String
fileName
,
MessageTree
tree
)
throws
IOException
{
LocalMessageBucket
bucket
=
m_buckets
.
get
(
fileName
);
return
bucket
.
getChannelBuf
(
tree
);
}
public
void
storeMessage
(
Dump
Tree
Item
item
)
throws
IOException
{
public
void
storeMessage
(
DumpItem
item
)
throws
IOException
{
LocalMessageBucket
bucket
=
m_buckets
.
get
(
item
.
getFileName
());
bucket
.
storeChannelBuf
(
item
.
getIndex
(),
item
.
getSize
(),
item
.
getBytes
());
bucket
.
storeChannelBuf
(
item
.
getIndex
(),
item
.
getSize
(),
item
.
getBytes
());
}
@Override
...
...
cat-home/src/main/webapp/jsp/report/home.jsp
浏览文件 @
1b5fd6af
...
...
@@ -37,9 +37,11 @@ Welcome to <b>Central Application Tracking (CAT)</b>.
<br>
<br>
<table>
<tr
class=
"even"
><td>
序号
</td><td>
常见问题
</td></tr>
<tr
class=
"odd"
><td>
1
</td><td>
Transaction、Event历史报表,图表X轴以5分钟为刻度,Y轴表示每5分钟的值
</td></tr>
<tr
class=
"odd"
><td>
2
</td><td>
Problem、Heartbeat历史报表,图表X轴以1分钟为刻度,Y轴表示每1分钟的值
</td></tr>
<tr
class=
"even"
><td>
序号
</td><td>
常见问题
</td><td>
解答
</td></tr>
<tr
class=
"odd"
><td>
1
</td><td>
TestCase跑不起来
</td><td>
升级至CAT的0.4.0的版本,Pigeon版本至1.6.1
</td></tr>
<tr
class=
"even"
><td>
2
</td><td>
集成了CAT,但是在测试环境看不到信息
</td><td>
请check相关步骤
<a
href=
"http://wiki.dianpingoa.com/bin/view/SOA%E6%9E%B6%E6%9E%84/CAT%E9%9B%86%E6%88%90%E5%B8%AE%E5%8A%A9%E6%96%87%E6%A1%A3"
target=
"_blank"
>
CAT集成帮助文档
</a></td></tr>
<tr
class=
"odd"
><td>
3
</td><td>
Transaction、Event报表区间
</
<
td><td>
Transaction、Event历史报表,图表X轴以5分钟为刻度,Y轴表示每5分钟的值
</td></tr>
<tr
class=
"even"
><td>
4
</td><td>
Problem、Hearbeat报表区间
</
<
td><td>
Problem、Heartbeat历史报表,图表X轴以1分钟为刻度,Y轴表示每1分钟的值
</td></tr>
</table>
<br>
<br>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录