Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
8dde8424
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,发现更多精彩内容 >>
提交
8dde8424
编写于
12月 18, 2012
作者:
Y
youyong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the url encode add the test case
上级
7eb9ca02
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
195 addition
and
71 deletion
+195
-71
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
+2
-1
cat-consumer/src/test/java/com/dianping/cat/consumer/transaction/TransactionReportFilterTest.java
...cat/consumer/transaction/TransactionReportFilterTest.java
+1
-1
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/main/java/com/dianping/cat/report/page/dashboard/Handler.java
.../java/com/dianping/cat/report/page/dashboard/Handler.java
+3
-0
cat-home/src/main/webapp/css/matrix.css
cat-home/src/main/webapp/css/matrix.css
+1
-5
cat-home/src/main/webapp/jsp/report/matrix.jsp
cat-home/src/main/webapp/jsp/report/matrix.jsp
+1
-1
cat-home/src/main/webapp/jsp/report/matrixHistoryReport.jsp
cat-home/src/main/webapp/jsp/report/matrixHistoryReport.jsp
+1
-1
cat-home/src/test/java/com/dianping/cat/report/analyzer/UrlTransactionBugTest.java
...m/dianping/cat/report/analyzer/UrlTransactionBugTest.java
+155
-0
cat-home/src/test/java/com/dianping/cat/report/analyzer/UrlTransasctionBugTest.java
.../dianping/cat/report/analyzer/UrlTransasctionBugTest.java
+0
-54
cat-home/src/test/resources/com/dianping/cat/report/analyzer/TransactionReportOld.xml
...com/dianping/cat/report/analyzer/TransactionReportOld.xml
+23
-0
cat-job/pom.xml
cat-job/pom.xml
+1
-1
pom.xml
pom.xml
+1
-1
未找到文件。
bee-engine/pom.xml
浏览文件 @
8dde8424
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.1.
1
</version>
<version>
0.5.1.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.dianping.bee
</groupId>
...
...
cat-consumer/pom.xml
浏览文件 @
8dde8424
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.1.
1
</version>
<version>
0.5.1.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-consumer
</artifactId>
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionReportUrlFilter.java
浏览文件 @
8dde8424
...
...
@@ -68,7 +68,8 @@ public class TransactionReportUrlFilter extends com.dianping.cat.consumer.transa
int
length
=
temp
.
length
();
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
if
(
temp
.
charAt
(
i
)
>
255
||
temp
.
charAt
(
i
)
<
0
)
{
//invalidate char
if
(
temp
.
charAt
(
i
)
>
126
||
temp
.
charAt
(
i
)
<
33
)
{
invalidates
.
add
(
temp
);
continue
;
}
...
...
cat-consumer/src/test/java/com/dianping/cat/consumer/transaction/TransactionReportFilterTest.java
浏览文件 @
8dde8424
...
...
@@ -38,7 +38,7 @@ public class TransactionReportFilterTest {
Assert
.
assertEquals
(
201
,
newSize
);
String
url
=
"/topic/341739¬g""
;
String
url
=
"/topic/34173
9¬g""
;
size
=
url
.
length
();
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
...
...
cat-core/pom.xml
浏览文件 @
8dde8424
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.1.
1
</version>
<version>
0.5.1.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-core
</artifactId>
...
...
cat-data/pom.xml
浏览文件 @
8dde8424
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.1.
1
</version>
<version>
0.5.1.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-data
</artifactId>
...
...
cat-hadoop/pom.xml
浏览文件 @
8dde8424
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.1.
1
</version>
<version>
0.5.1.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-hadoop
</artifactId>
...
...
cat-home/pom.xml
浏览文件 @
8dde8424
...
...
@@ -3,7 +3,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.1.
1
</version>
<version>
0.5.1.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-home
</artifactId>
...
...
cat-home/src/main/java/com/dianping/cat/report/page/dashboard/Handler.java
浏览文件 @
8dde8424
...
...
@@ -191,6 +191,9 @@ public class Handler implements PageHandler<Context> {
TransactionReport
transactionReport
=
getTransactionHourlyReport
(
domain
,
ip
,
null
);
if
(
transactionReport
==
null
){
return
data
;
}
Machine
transactionMachine
=
transactionReport
.
getMachines
().
get
(
ip
);
if
(
transactionMachine
!=
null
)
{
Collection
<
TransactionType
>
types
=
transactionMachine
.
getTypes
().
values
();
...
...
cat-home/src/main/webapp/css/matrix.css
浏览文件 @
8dde8424
.matrix
{
width
:
auto
;
width
:
100%
;
font-size
:
small
;
}
...
...
@@ -18,10 +18,6 @@
text-align
:
left
;
}
.matrix
tr
.left
{
text-align
:
left
;
}
.matrix
tr
.left
{
text-align
:
left
;
}
\ No newline at end of file
cat-home/src/main/webapp/jsp/report/matrix.jsp
浏览文件 @
8dde8424
...
...
@@ -50,7 +50,7 @@
varStatus=
"status"
>
<tr
class=
"${status.index mod 2 != 0 ? 'odd' : 'even'}"
>
<td
class=
"left"
>
${item.type}
</td>
<td
class=
"left longText"
>
${w:shorten(item.name, 120)}
</td>
<td
class=
"left longText"
style=
"white-space:normal"
>
${w:shorten(item.name, 120)}
</td>
<td>
${item.count}
</td>
<td>
${w:format(item.avg,'0.0')}
</td>
<td><a
href=
"${model.logViewBaseUri}/${item.url}?domain=${model.domain}"
>
Log View
</a></td>
...
...
cat-home/src/main/webapp/jsp/report/matrixHistoryReport.jsp
浏览文件 @
8dde8424
...
...
@@ -50,7 +50,7 @@
varStatus=
"status"
>
<tr
class=
"${status.index mod 2 != 0 ? 'odd' : 'even'}"
>
<td
class=
"left"
>
${item.type}
</td>
<td
class=
"left
longText
"
>
${w:shorten(item.name, 120)}
</td>
<td
class=
"left
longText"
style=
"white-space:normal
"
>
${w:shorten(item.name, 120)}
</td>
<td>
${item.count}
</td>
<td>
${w:format(item.avg,'0.0')}
</td>
<td><a
href=
"${model.logViewBaseUri}/${item.url}?domain=${model.domain}"
>
Log View
</a></td>
...
...
cat-home/src/test/java/com/dianping/cat/report/analyzer/UrlTransactionBugTest.java
0 → 100644
浏览文件 @
8dde8424
package
com.dianping.cat.report.analyzer
;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.unidal.lookup.ComponentTestCase
;
import
org.unidal.lookup.annotation.Inject
;
import
com.dainping.cat.consumer.dal.report.Report
;
import
com.dainping.cat.consumer.dal.report.ReportDao
;
import
com.dainping.cat.consumer.dal.report.ReportEntity
;
import
com.dianping.cat.Cat
;
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
;
import
com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser
;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.home.dal.report.DailyreportDao
;
import
com.site.helper.Files
;
public
class
UrlTransactionBugTest
extends
ComponentTestCase
{
@Inject
private
DailyreportDao
m_dailyreportDao
;
@Inject
private
ReportDao
m_reportDao
;
@Before
public
void
setUp
()
throws
Exception
{
super
.
setUp
();
m_dailyreportDao
=
lookup
(
DailyreportDao
.
class
);
m_reportDao
=
lookup
(
ReportDao
.
class
);
}
public
void
test
()
throws
Exception
{
// fix the transaction xml parse builder
String
dateStr
=
"2012-12-16 07: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
),
"ShopWeb"
,
"transaction"
,
ReportEntity
.
READSET_FULL
);
File
file
=
new
File
(
"text.txt"
);
for
(
Report
report
:
reports
)
{
try
{
DefaultSaxParser
.
parse
(
report
.
getContent
());
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
Files
.
forIO
().
writeTo
(
file
,
report
.
getContent
());
}
}
}
public
void
insert
()
throws
Exception
{
String
xml
=
Files
.
forIO
().
readFrom
(
new
File
(
"text.xml"
),
"utf-8"
);
System
.
out
.
println
(
xml
.
length
());
try
{
Report
r
=
m_reportDao
.
createLocal
();
// String xml = new TransactionReportUrlFilter().buildXml(report);
String
domain
=
"CatTest"
;
r
.
setName
(
"transaction"
);
r
.
setDomain
(
domain
);
r
.
setPeriod
(
TimeUtil
.
getCurrentDay
());
r
.
setIp
(
"127.0.0.1"
);
r
.
setType
(
1
);
r
.
setContent
(
xml
);
System
.
out
.
println
(
"insertBefore"
);
m_reportDao
.
insert
(
r
);
System
.
out
.
println
(
"insert"
);
}
catch
(
Throwable
e
)
{
System
.
out
.
println
(
e
);
Cat
.
getProducer
().
logError
(
e
);
}
List
<
Report
>
temp
=
m_reportDao
.
findAllByPeriodDomainName
(
TimeUtil
.
getCurrentDay
(),
"CatTest"
,
"transaction"
,
ReportEntity
.
READSET_FULL
);
System
.
out
.
println
(
temp
.
size
());
for
(
Report
re
:
temp
)
{
TransactionReport
report
=
DefaultSaxParser
.
parse
(
re
.
getContent
());
new
Vistor
().
visitTransactionReport
(
report
);
}
}
static
class
Vistor
extends
com
.
dianping
.
cat
.
consumer
.
transaction
.
model
.
transform
.
BaseVisitor
{
@Override
public
void
visitType
(
TransactionType
type
)
{
if
(
"URL"
.
equals
(
type
.
getId
()))
{
super
.
visitType
(
type
);
}
}
@Override
public
void
visitName
(
TransactionName
name
)
{
if
(
name
.
getId
().
indexOf
(
"2529898"
)
>
-
1
)
{
System
.
out
.
println
(
name
.
getId
());
}
super
.
visitName
(
name
);
}
}
@Test
public
void
testDataBaseOnLine
()
throws
Exception
{
byte
[]
data
=
Files
.
forIO
().
readFrom
(
new
File
(
"report-transaction"
));
String
all
=
new
String
(
data
,
1946326
,
11610469
-
1946326
);
String
shopWeb
=
all
;
System
.
out
.
println
(
shopWeb
.
substring
(
7
,
100
));
int
length
=
shopWeb
.
length
();
System
.
out
.
println
(
shopWeb
.
substring
(
length
-
100
,
length
));
System
.
out
.
println
(
"Old Length"
+
shopWeb
.
length
());
String
domain
=
System
.
currentTimeMillis
()
+
""
;
try
{
Report
r
=
m_reportDao
.
createLocal
();
// String xml = new TransactionReportUrlFilter().buildXml(report);
r
.
setName
(
"transaction"
);
r
.
setDomain
(
domain
);
r
.
setPeriod
(
TimeUtil
.
getCurrentDay
());
r
.
setIp
(
"127.0.0.1"
);
r
.
setType
(
1
);
r
.
setContent
(
shopWeb
);
m_reportDao
.
insert
(
r
);
}
catch
(
Throwable
e
)
{
System
.
out
.
println
(
e
);
Cat
.
getProducer
().
logError
(
e
);
}
Files
.
forIO
().
writeTo
(
new
File
(
"sfs.xml"
),
shopWeb
.
substring
(
7
,
shopWeb
.
length
()).
trim
());
TransactionReport
report1
=
DefaultSaxParser
.
parse
(
shopWeb
);
System
.
out
.
println
(
">>>>>>>"
+
report1
.
getMachines
().
size
());
List
<
Report
>
temp
=
m_reportDao
.
findAllByPeriodDomainName
(
TimeUtil
.
getCurrentDay
(),
domain
,
"transaction"
,
ReportEntity
.
READSET_FULL
);
System
.
out
.
println
(
"temp size"
+
temp
.
size
());
for
(
Report
re
:
temp
)
{
String
content
=
re
.
getContent
();
System
.
out
.
println
(
"New Length:"
+
content
.
length
());
System
.
out
.
println
(
content
.
substring
(
0
,
100
));
System
.
out
.
println
(
content
.
substring
(
length
-
100
,
length
));
TransactionReport
report
=
DefaultSaxParser
.
parse
(
content
);
new
Vistor
().
visitTransactionReport
(
report
);
}
}
}
\ No newline at end of file
cat-home/src/test/java/com/dianping/cat/report/analyzer/UrlTransasctionBugTest.java
已删除
100644 → 0
浏览文件 @
7eb9ca02
package
com.dianping.cat.report.analyzer
;
import
java.io.File
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.unidal.lookup.ComponentTestCase
;
import
org.unidal.lookup.annotation.Inject
;
import
com.dainping.cat.consumer.dal.report.Report
;
import
com.dainping.cat.consumer.dal.report.ReportDao
;
import
com.dainping.cat.consumer.dal.report.ReportEntity
;
import
com.dianping.cat.consumer.transaction.model.entity.TransactionReport
;
import
com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser
;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.home.dal.report.DailyreportDao
;
import
com.site.helper.Files
;
public
class
UrlTransasctionBugTest
extends
ComponentTestCase
{
@Inject
private
DailyreportDao
m_dailyreportDao
;
@Inject
private
ReportDao
m_reportDao
;
@Before
public
void
setUp
()
throws
Exception
{
super
.
setUp
();
m_dailyreportDao
=
lookup
(
DailyreportDao
.
class
);
m_reportDao
=
lookup
(
ReportDao
.
class
);
}
@Test
public
void
test
()
throws
Exception
{
//fix the transaction xml parse builder
String
dateStr
=
"2012-12-14 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
),
"GroupWeb"
,
"transaction"
,
ReportEntity
.
READSET_FULL
);
File
file
=
new
File
(
"text.txt"
);
for
(
Report
report
:
reports
)
{
try
{
DefaultSaxParser
.
parse
(
report
.
getContent
());
}
catch
(
Exception
e
)
{
Files
.
forIO
().
writeTo
(
file
,
report
.
getContent
());
}
}
}
}
\ No newline at end of file
cat-home/src/test/resources/com/dianping/cat/report/analyzer/TransactionReportOld.xml
0 → 100755
浏览文件 @
8dde8424
<?xml version="1.0" encoding="utf-8"?>
<transaction-report
domain=
"Cat"
startTime=
"2012-05-17 13:00:00"
endTime=
"2012-05-17 13:59:59"
>
<domain>
Cat
</domain>
<ip>
192.168.165.1
</ip>
<machine
ip=
"192.168.165.1"
>
<type
id=
"Task1"
totalCount=
"2"
failCount=
"0"
failPercent=
"0.00"
min=
"21.422"
max=
"28.35"
avg=
"24.9"
sum=
"49.8"
sum2=
"1262.6"
std=
"3.5"
tps=
"0.00"
line95Value=
"28.00"
line95Sum=
"28.00"
line95Count=
"1"
>
<successMessageUrl>
Cat-c0a8a501-1337230848968-0
</successMessageUrl>
<name
id=
"Status1"
totalCount=
"2"
failCount=
"0"
failPercent=
"0.00"
min=
"21.422"
max=
"28.35"
avg=
"24.9"
sum=
"49.8"
sum2=
"1262.6"
std=
"3.5"
tps=
"0.00"
line95Value=
"28.00"
line95Sum=
"28.00"
line95Count=
"1"
>
<successMessageUrl>
Cat-c0a8a501-1337230848968-0
</successMessageUrl>
<range
value=
"0"
count=
"2"
sum=
"49.772000000000006"
avg=
"24.9"
fails=
"0"
/>
<duration
value=
"32"
count=
"2"
/>
</name>
</type>
<type
id=
"URL"
totalCount=
"1"
failCount=
"0"
failPercent=
"0.00"
min=
"39780.276"
max=
"39780.276"
avg=
"39780.3"
sum=
"39780.3"
sum2=
"1582470358.6"
std=
"0.0"
tps=
"0.00"
line95Value=
"39780.00"
line95Sum=
"39780.00"
line95Count=
"1"
>
<successMessageUrl>
Cat-c0a8a501-1337230896586-0
</successMessageUrl>
<name
id=
"model2"
totalCount=
"1"
failCount=
"0"
failPercent=
"0.00"
min=
"39780.276"
max=
"39780.276"
avg=
"39780.3"
sum=
"39780.3"
sum2=
"1582470358.6"
std=
"0.0"
tps=
"0.00"
line95Value=
"39780.00"
line95Sum=
"39780.00"
line95Count=
"1"
>
<successMessageUrl>
Cat-c0a8a501-1337230896586-0
</successMessageUrl>
<range
value=
"0"
count=
"1"
sum=
"39780.276"
avg=
"39780.3"
fails=
"0"
/>
<duration
value=
"65536"
count=
"1"
/>
</name>
</type>
</machine>
</transaction-report>
cat-job/pom.xml
浏览文件 @
8dde8424
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.1.
1
</version>
<version>
0.5.1.
2
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-job
</artifactId>
...
...
pom.xml
浏览文件 @
8dde8424
...
...
@@ -4,7 +4,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.dianping.cat
</groupId>
<artifactId>
parent
</artifactId>
<version>
0.5.1.
1
</version>
<version>
0.5.1.
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录