Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
62f64b4b
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,发现更多精彩内容 >>
提交
62f64b4b
编写于
7月 18, 2014
作者:
Y
youyong205
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #401 from youyong205/master
modify the sql
上级
0946b4f0
38e70dfb
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
61 addition
and
70 deletion
+61
-70
cat-broker/src/main/java/com/dianping/cat/broker/build/ComponentsConfigurator.java
...com/dianping/cat/broker/build/ComponentsConfigurator.java
+2
-3
cat-broker/src/main/resources/META-INF/plexus/components.xml
cat-broker/src/main/resources/META-INF/plexus/components.xml
+3
-0
cat-client/src/main/java/com/dianping/cat/servlet/CatFilter.java
...ent/src/main/java/com/dianping/cat/servlet/CatFilter.java
+48
-61
cat-consumer-advanced/src/test/java/com/dianping/cat/consumer/metric/MetricConfigManagerTest.java
...dianping/cat/consumer/metric/MetricConfigManagerTest.java
+0
-1
cat-core/src/main/java/com/dianping/cat/config/app/AppDataService.java
...main/java/com/dianping/cat/config/app/AppDataService.java
+5
-1
cat-core/src/main/resources/META-INF/dal/jdbc/app-dal.xml
cat-core/src/main/resources/META-INF/dal/jdbc/app-dal.xml
+2
-3
cat-home/src/main/java/com/dianping/cat/report/task/alert/AlertInfo.java
...in/java/com/dianping/cat/report/task/alert/AlertInfo.java
+1
-1
未找到文件。
cat-broker/src/main/java/com/dianping/cat/broker/build/ComponentsConfigurator.java
浏览文件 @
62f64b4b
...
...
@@ -25,17 +25,16 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
all
.
add
(
C
(
IpService
.
class
));
all
.
add
(
C
(
RequestUtils
.
class
));
all
.
add
(
C
(
MonitorManager
.
class
).
req
(
UrlPatternConfigManager
.
class
,
IpService
.
class
));
all
.
add
(
C
(
AppDataConsumer
.
class
).
req
(
AppDataService
.
class
));
all
.
add
(
C
(
TableProvider
.
class
,
"app-data-command"
,
AppDataCommandTableProvider
.
class
));
// database
all
.
add
(
C
(
JdbcDataSourceDescriptorManager
.
class
)
//
.
config
(
E
(
"datasourceFile"
).
value
(
"/data/appdatas/cat/datasources.xml"
)));
all
.
addAll
(
new
AppDatabaseConfigurator
().
defineComponents
());
// Please keep it as last
all
.
addAll
(
new
WebComponentConfigurator
().
defineComponents
());
...
...
cat-broker/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
62f64b4b
...
...
@@ -163,6 +163,9 @@
<requirement>
<role>
com.dianping.cat.app.AppDataCommandDao
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.config.app.AppConfigManager
</role>
</requirement>
</requirements>
</component>
<component>
...
...
cat-client/src/main/java/com/dianping/cat/servlet/CatFilter.java
浏览文件 @
62f64b4b
...
...
@@ -92,20 +92,6 @@ public class CatFilter implements Filter {
}
}
protected
String
getCookie
(
HttpServletRequest
req
,
String
name
)
{
Cookie
[]
cookies
=
req
.
getCookies
();
if
(
cookies
!=
null
)
{
for
(
Cookie
cookie
:
cookies
)
{
if
(
name
.
equalsIgnoreCase
(
cookie
.
getName
()))
{
return
cookie
.
getValue
();
}
}
}
return
null
;
}
@Override
public
void
handle
(
Context
ctx
)
throws
IOException
,
ServletException
{
HttpServletRequest
req
=
ctx
.
getRequest
();
...
...
@@ -117,8 +103,6 @@ public class CatFilter implements Filter {
ctx
.
setMode
(
detectMode
(
req
));
ctx
.
setType
(
CatConstants
.
TYPE_URL
);
Cat
.
setup
(
getCookie
(
req
,
"JSESSIONID"
));
setTraceMode
(
req
);
}
else
{
ctx
.
setType
(
CatConstants
.
TYPE_URL_FORWARD
);
...
...
@@ -171,51 +155,55 @@ public class CatFilter implements Filter {
@Override
public
void
handle
(
Context
ctx
)
throws
IOException
,
ServletException
{
HttpServletRequest
req
=
ctx
.
getRequest
();
HttpServletResponse
res
=
ctx
.
getResponse
();
MessageProducer
producer
=
Cat
.
getProducer
();
int
mode
=
ctx
.
getMode
();
switch
(
mode
)
{
case
0
:
ctx
.
setId
(
producer
.
createMessageId
());
break
;
case
1
:
ctx
.
setRootId
(
req
.
getHeader
(
"X-CAT-ROOT-ID"
));
ctx
.
setParentId
(
req
.
getHeader
(
"X-CAT-PARENT-ID"
));
ctx
.
setId
(
req
.
getHeader
(
"X-CAT-ID"
));
break
;
case
2
:
ctx
.
setRootId
(
producer
.
createMessageId
());
ctx
.
setParentId
(
ctx
.
getRootId
());
ctx
.
setId
(
producer
.
createMessageId
());
break
;
default
:
throw
new
RuntimeException
(
String
.
format
(
"Internal Error: unsupported mode(%s)!"
,
mode
));
}
boolean
isTraceMode
=
Cat
.
getManager
().
isTraceMode
();
if
(
isTraceMode
)
{
HttpServletRequest
req
=
ctx
.
getRequest
();
HttpServletResponse
res
=
ctx
.
getResponse
();
MessageProducer
producer
=
Cat
.
getProducer
();
int
mode
=
ctx
.
getMode
();
switch
(
mode
)
{
case
0
:
ctx
.
setId
(
producer
.
createMessageId
());
break
;
case
1
:
ctx
.
setRootId
(
req
.
getHeader
(
"X-CAT-ROOT-ID"
));
ctx
.
setParentId
(
req
.
getHeader
(
"X-CAT-PARENT-ID"
));
ctx
.
setId
(
req
.
getHeader
(
"X-CAT-ID"
));
break
;
case
2
:
ctx
.
setRootId
(
producer
.
createMessageId
());
ctx
.
setParentId
(
ctx
.
getRootId
());
ctx
.
setId
(
producer
.
createMessageId
());
break
;
default
:
throw
new
RuntimeException
(
String
.
format
(
"Internal Error: unsupported mode(%s)!"
,
mode
));
}
MessageTree
tree
=
Cat
.
getManager
().
getThreadLocalMessageTree
();
tree
.
setMessageId
(
ctx
.
getId
());
tree
.
setParentMessageId
(
ctx
.
getParentId
());
tree
.
setRootMessageId
(
ctx
.
getRootId
());
res
.
setHeader
(
"X-CAT-SERVER"
,
getCatServer
());
switch
(
mode
)
{
case
0
:
res
.
setHeader
(
"X-CAT-ROOT-ID"
,
ctx
.
getId
());
break
;
case
1
:
res
.
setHeader
(
"X-CAT-ROOT-ID"
,
ctx
.
getRootId
());
res
.
setHeader
(
"X-CAT-PARENT-ID"
,
ctx
.
getParentId
());
res
.
setHeader
(
"X-CAT-ID"
,
ctx
.
getId
());
break
;
case
2
:
res
.
setHeader
(
"X-CAT-ROOT-ID"
,
ctx
.
getRootId
());
res
.
setHeader
(
"X-CAT-PARENT-ID"
,
ctx
.
getParentId
());
res
.
setHeader
(
"X-CAT-ID"
,
ctx
.
getId
());
break
;
MessageTree
tree
=
Cat
.
getManager
().
getThreadLocalMessageTree
();
tree
.
setMessageId
(
ctx
.
getId
());
tree
.
setParentMessageId
(
ctx
.
getParentId
());
tree
.
setRootMessageId
(
ctx
.
getRootId
());
res
.
setHeader
(
"X-CAT-SERVER"
,
getCatServer
());
switch
(
mode
)
{
case
0
:
res
.
setHeader
(
"X-CAT-ROOT-ID"
,
ctx
.
getId
());
break
;
case
1
:
res
.
setHeader
(
"X-CAT-ROOT-ID"
,
ctx
.
getRootId
());
res
.
setHeader
(
"X-CAT-PARENT-ID"
,
ctx
.
getParentId
());
res
.
setHeader
(
"X-CAT-ID"
,
ctx
.
getId
());
break
;
case
2
:
res
.
setHeader
(
"X-CAT-ROOT-ID"
,
ctx
.
getRootId
());
res
.
setHeader
(
"X-CAT-PARENT-ID"
,
ctx
.
getParentId
());
res
.
setHeader
(
"X-CAT-ID"
,
ctx
.
getId
());
break
;
}
}
ctx
.
handle
();
...
...
@@ -531,7 +519,6 @@ public class CatFilter implements Filter {
public
String
toString
()
{
return
m_cookie
.
toString
();
}
}
protected
static
interface
Handler
{
...
...
cat-consumer-advanced/src/test/java/com/dianping/cat/consumer/metric/MetricConfigManagerTest.java
浏览文件 @
62f64b4b
...
...
@@ -74,7 +74,6 @@ public class MetricConfigManagerTest {
configs
.
put
(
item
,
3L
);
Assert
.
assertEquals
(
3L
,
configs
.
get
(
item
).
longValue
());
Assert
.
assertEquals
(
1
,
configs
.
size
());
}
@Test
...
...
cat-core/src/main/java/com/dianping/cat/config/app/AppDataService.java
浏览文件 @
62f64b4b
...
...
@@ -33,9 +33,13 @@ public class AppDataService {
public
static
final
String
DELAY_AVG
=
"成功延时(ms)"
;
public
void
insert
(
AppDataCommand
proto
)
throws
DalException
{
m_dao
.
insert
Data
(
proto
);
m_dao
.
insert
(
proto
);
}
public
void
insert
(
AppDataCommand
[]
proto
)
throws
DalException
{
m_dao
.
insert
(
proto
);
}
public
double
[]
queryValue
(
QueryEntity
entity
,
String
type
)
{
int
commandId
=
entity
.
getCommand
();
Date
period
=
entity
.
getDate
();
...
...
cat-core/src/main/resources/META-INF/dal/jdbc/app-dal.xml
浏览文件 @
62f64b4b
...
...
@@ -27,11 +27,10 @@
</readset>
</readsets>
<query-defs>
<query
name=
"insert-data"
type=
"INSERT"
>
<param
name=
"command-id"
/>
<query
name=
"insert"
type=
"INSERT"
batch=
"true"
>
<statement>
<![CDATA[INSERT INTO <TABLE/>
(
<FIELDS/>
)
VALUES(
<VALUES/>
)]]>
</statement>
</query>
</query>
<query
name=
"find-data-by-minute"
type=
"SELECT"
multiple=
"true"
>
<param
name=
"command-id"
/><param
name=
"period"
/>
<param
name=
"period"
/>
...
...
cat-home/src/main/java/com/dianping/cat/report/task/alert/AlertInfo.java
浏览文件 @
62f64b4b
...
...
@@ -38,7 +38,7 @@ public class AlertInfo implements Initializable {
keys
.
add
(
entry
.
getKey
());
}
}
return
keys
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录