Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
028ae023
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,发现更多精彩内容 >>
提交
028ae023
编写于
12月 14, 2012
作者:
Y
youyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the cat parse exception
上级
cbe9abb2
变更
12
展开全部
隐藏空白更改
内联
并排
Showing
12 changed file
with
34378 addition
and
16 deletion
+34378
-16
bee-engine/pom.xml
bee-engine/pom.xml
+1
-1
cat-consumer/pom.xml
cat-consumer/pom.xml
+1
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportUrlFilter.java
.../cat/consumer/transaction/TransactionReportUrlFilter.java
+35
-2
cat-consumer/src/test/java/com/dianping/cat/consumer/transaction/TransactionReportFilterTest.java
...cat/consumer/transaction/TransactionReportFilterTest.java
+11
-2
cat-core/pom.xml
cat-core/pom.xml
+1
-1
cat-data/pom.xml
cat-data/pom.xml
+1
-1
cat-hadoop/pom.xml
cat-hadoop/pom.xml
+1
-1
cat-home/pom.xml
cat-home/pom.xml
+1
-1
cat-home/src/test/java/com/dianping/cat/report/analyzer/UrlTransasctionBugTest.java
.../dianping/cat/report/analyzer/UrlTransasctionBugTest.java
+3
-4
cat-home/text.xml
cat-home/text.xml
+34321
-0
cat-job/pom.xml
cat-job/pom.xml
+1
-1
pom.xml
pom.xml
+1
-1
未找到文件。
bee-engine/pom.xml
浏览文件 @
028ae023
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.
0
</version>
<version>
0.5.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.dianping.bee
</groupId>
...
...
cat-consumer/pom.xml
浏览文件 @
028ae023
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.
0
</version>
<version>
0.5.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-consumer
</artifactId>
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportUrlFilter.java
浏览文件 @
028ae023
...
...
@@ -3,16 +3,24 @@ package com.dianping.cat.consumer.transaction;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
org.codehaus.plexus.logging.LogEnabled
;
import
org.codehaus.plexus.logging.Logger
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionName
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionType
;
public
class
TransactionReportUrlFilter
extends
com
.
dianping
.
cat
.
consumer
.
transaction
.
model
.
transform
.
DefaultXmlBuilder
{
public
class
TransactionReportUrlFilter
extends
com
.
dianping
.
cat
.
consumer
.
transaction
.
model
.
transform
.
DefaultXmlBuilder
implements
LogEnabled
{
private
int
m_maxItems
=
200
;
private
int
m_maxItems
=
500
;
private
Logger
m_logger
;
private
void
mergeName
(
TransactionName
old
,
TransactionName
other
)
{
old
.
setTotalCount
(
old
.
getTotalCount
()
+
other
.
getTotalCount
());
...
...
@@ -52,6 +60,26 @@ public class TransactionReportUrlFilter extends com.dianping.cat.consumer.transa
public
void
visitType
(
TransactionType
type
)
{
if
(
"URL"
.
equals
(
type
.
getId
()))
{
Map
<
String
,
TransactionName
>
transactionNames
=
type
.
getNames
();
Set
<
String
>
names
=
transactionNames
.
keySet
();
Set
<
String
>
invalidates
=
new
HashSet
<
String
>();
for
(
String
temp
:
names
)
{
int
length
=
temp
.
length
();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
if
(
temp
.
charAt
(
i
)
>
255
||
temp
.
charAt
(
i
)
<
0
)
{
invalidates
.
add
(
temp
);
continue
;
}
}
}
for
(
String
name
:
invalidates
)
{
m_logger
.
error
(
"remove invalidate url "
+
name
);
transactionNames
.
remove
(
name
);
}
int
size
=
transactionNames
.
size
();
if
(
size
>
m_maxItems
)
{
...
...
@@ -80,4 +108,9 @@ public class TransactionReportUrlFilter extends com.dianping.cat.consumer.transa
return
(
int
)
(
o2
.
getTotalCount
()
-
o1
.
getTotalCount
());
}
}
@Override
public
void
enableLogging
(
Logger
logger
)
{
m_logger
=
logger
;
}
}
\ No newline at end of file
cat-consumer/src/test/java/com/dianping/cat/consumer/transaction/TransactionReportFilterTest.java
浏览文件 @
028ae023
...
...
@@ -27,15 +27,24 @@ public class TransactionReportFilterTest {
System
.
out
.
println
(
report
.
toString
().
length
());
System
.
out
.
println
(
"Name size :"
+
type
.
getNames
().
size
());
TransactionReportUrlFilter
f1
=
new
TransactionReportUrlFilter
();
String
filterReport
=
f1
.
buildXml
(
report
);
TransactionReport
newReport
=
parser
.
parse
(
filterReport
);
System
.
out
.
println
(
newReport
.
toString
().
length
());
int
newSize
=
newReport
.
findMachine
(
"10.1.77.193"
).
findType
(
"URL"
).
getNames
().
size
();
Assert
.
assertEquals
(
5
01
,
newSize
);
Assert
.
assertEquals
(
2
01
,
newSize
);
String
url
=
"/topic/341739¬g""
;
size
=
url
.
length
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
if
(
url
.
charAt
(
i
)
>
255
||
url
.
charAt
(
i
)
<
0
)
{
System
.
out
.
println
(
i
+
" "
+
url
.
charAt
(
i
));
}
}
}
}
cat-core/pom.xml
浏览文件 @
028ae023
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.
0
</version>
<version>
0.5.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-core
</artifactId>
...
...
cat-data/pom.xml
浏览文件 @
028ae023
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.
0
</version>
<version>
0.5.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-data
</artifactId>
...
...
cat-hadoop/pom.xml
浏览文件 @
028ae023
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.
0
</version>
<version>
0.5.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-hadoop
</artifactId>
...
...
cat-home/pom.xml
浏览文件 @
028ae023
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.
0
</version>
<version>
0.5.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-home
</artifactId>
...
...
cat-home/src/test/java/com/dianping/cat/report/analyzer/UrlTransasctionBugTest.java
浏览文件 @
028ae023
...
...
@@ -37,16 +37,15 @@ public class UrlTransasctionBugTest extends ComponentTestCase {
@Test
public
void
test
()
throws
Exception
{
//fix the transaction xml parse builder
String
dateStr
=
"2012-12-1
3 14
:00:00"
;
String
dateStr
=
"2012-12-1
4 19
:00:00"
;
Date
date
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
).
parse
(
dateStr
);
List
<
Report
>
reports
=
m_reportDao
.
findAllByDomainNameDuration
(
date
,
new
Date
(
date
.
getTime
()
+
TimeUtil
.
ONE_HOUR
),
"
Sho
pWeb"
,
"transaction"
,
ReportEntity
.
READSET_FULL
);
new
Date
(
date
.
getTime
()
+
TimeUtil
.
ONE_HOUR
),
"
Grou
pWeb"
,
"transaction"
,
ReportEntity
.
READSET_FULL
);
File
file
=
new
File
(
"text.txt"
);
for
(
Report
report
:
reports
)
{
try
{
TransactionReport
temp
=
DefaultSaxParser
.
parse
(
report
.
getContent
());
System
.
out
.
println
(
temp
);
DefaultSaxParser
.
parse
(
report
.
getContent
());
}
catch
(
Exception
e
)
{
Files
.
forIO
().
writeTo
(
file
,
report
.
getContent
());
}
...
...
cat-home/text.xml
0 → 100644
浏览文件 @
028ae023
此差异已折叠。
点击以展开。
cat-job/pom.xml
浏览文件 @
028ae023
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.
0
</version>
<version>
0.5.
1
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-job
</artifactId>
...
...
pom.xml
浏览文件 @
028ae023
...
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.
0
</version>
<version>
0.5.
1
</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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录