Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
5d6ba2e1
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,体验更适合开发者的 AI 搜索 >>
提交
5d6ba2e1
编写于
10月 30, 2013
作者:
A
ainilife
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'biz' of
http://code.dianpingoa.com/arch/cat
into biz
上级
ba4b2667
1494246d
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
20 addition
and
58 deletion
+20
-58
cat-core/src/main/java/com/dianping/cat/ServerConfigManager.java
...e/src/main/java/com/dianping/cat/ServerConfigManager.java
+11
-15
cat-core/src/test/java/com/dianping/cat/consumer/AllTests.java
...ore/src/test/java/com/dianping/cat/consumer/AllTests.java
+0
-15
cat-core/src/test/java/com/dianping/cat/core/AllTests.java
cat-core/src/test/java/com/dianping/cat/core/AllTests.java
+0
-15
cat-home/src/main/java/com/dianping/cat/report/page/metric/Handler.java
...ain/java/com/dianping/cat/report/page/metric/Handler.java
+5
-10
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+0
-3
cat-home/src/main/webapp/jsp/report/metric/metric.jsp
cat-home/src/main/webapp/jsp/report/metric/metric.jsp
+1
-0
cat-home/src/test/java/com/dianping/cat/AllTests.java
cat-home/src/test/java/com/dianping/cat/AllTests.java
+3
-0
未找到文件。
cat-core/src/main/java/com/dianping/cat/ServerConfigManager.java
浏览文件 @
5d6ba2e1
...
...
@@ -38,6 +38,17 @@ public class ServerConfigManager implements Initializable, LogEnabled {
private
Set
<
String
>
m_unusedNames
=
new
HashSet
<
String
>();
public
boolean
discardTransaction
(
Transaction
t
)
{
// pigeon default heartbeat is no use
String
type
=
t
.
getType
();
String
name
=
t
.
getName
();
if
(
m_unusedTypes
.
contains
(
type
)
&&
m_unusedNames
.
contains
(
name
))
{
return
true
;
}
return
false
;
}
@Override
public
void
enableLogging
(
Logger
logger
)
{
m_logger
=
logger
;
...
...
@@ -313,17 +324,6 @@ public class ServerConfigManager implements Initializable, LogEnabled {
return
"PigeonService"
.
equals
(
type
)
||
"Service"
.
equals
(
type
);
}
public
boolean
discardTransaction
(
Transaction
t
)
{
// pigeon default heartbeat is no use
String
type
=
t
.
getType
();
String
name
=
t
.
getName
();
if
(
m_unusedTypes
.
contains
(
type
)
&&
m_unusedNames
.
contains
(
name
))
{
return
true
;
}
return
false
;
}
private
long
toLong
(
String
str
,
long
defaultValue
)
{
long
value
=
0
;
int
len
=
str
==
null
?
0
:
str
.
length
();
...
...
@@ -351,8 +351,4 @@ public class ServerConfigManager implements Initializable, LogEnabled {
return
!
domain
.
equals
(
"PhoenixAgent"
)
&&
!
domain
.
equals
(
Constants
.
FRONT_END
);
}
public
String
getDefaultProduct
(){
return
"TuanGou"
;
}
}
cat-core/src/test/java/com/dianping/cat/consumer/AllTests.java
已删除
100644 → 0
浏览文件 @
ba4b2667
package
com.dianping.cat.consumer
;
import
org.junit.runner.RunWith
;
import
org.junit.runners.Suite
;
import
org.junit.runners.Suite.SuiteClasses
;
@RunWith
(
Suite
.
class
)
@SuiteClasses
({
// add test classes here
})
public
class
AllTests
{
}
cat-core/src/test/java/com/dianping/cat/core/AllTests.java
已删除
100644 → 0
浏览文件 @
ba4b2667
package
com.dianping.cat.core
;
import
org.junit.runner.RunWith
;
import
org.junit.runners.Suite
;
import
org.junit.runners.Suite.SuiteClasses
;
@RunWith
(
Suite
.
class
)
@SuiteClasses
({
// add test classes here
})
public
class
AllTests
{
}
cat-home/src/main/java/com/dianping/cat/report/page/metric/Handler.java
浏览文件 @
5d6ba2e1
...
...
@@ -13,7 +13,6 @@ import org.unidal.web.mvc.annotation.InboundActionMeta;
import
org.unidal.web.mvc.annotation.OutboundActionMeta
;
import
org.unidal.web.mvc.annotation.PayloadMeta
;
import
com.dianping.cat.ServerConfigManager
;
import
com.dianping.cat.consumer.advanced.ProductLineConfigManager
;
import
com.dianping.cat.helper.TimeUtil
;
import
com.dianping.cat.report.ReportPage
;
...
...
@@ -34,9 +33,6 @@ public class Handler implements PageHandler<Context> {
@Inject
private
GraphCreator
m_graphCreator
;
@Inject
private
ServerConfigManager
m_serverConfigManager
;
@Override
@PayloadMeta
(
Payload
.
class
)
@InboundActionMeta
(
name
=
"metric"
)
...
...
@@ -48,15 +44,14 @@ public class Handler implements PageHandler<Context> {
public
void
handleOutbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
Model
model
=
new
Model
(
ctx
);
Payload
payload
=
ctx
.
getPayload
();
Action
action
=
payload
.
getAction
();
normalize
(
model
,
payload
);
long
date
=
payload
.
getDate
();
int
timeRange
=
payload
.
getTimeRange
();
Date
start
=
new
Date
(
date
-
(
timeRange
-
1
)
*
TimeUtil
.
ONE_HOUR
);
Date
end
=
new
Date
(
date
+
TimeUtil
.
ONE_HOUR
);
switch
(
action
)
{
switch
(
payload
.
getAction
()
)
{
case
METRIC:
Map
<
String
,
LineChart
>
charts
=
m_graphCreator
.
buildChartsByProductLine
(
payload
.
getProduct
(),
start
,
end
,
payload
.
getTest
());
...
...
@@ -75,12 +70,12 @@ public class Handler implements PageHandler<Context> {
private
void
normalize
(
Model
model
,
Payload
payload
)
{
model
.
setPage
(
ReportPage
.
METRIC
);
m_normalizePayload
.
normalize
(
model
,
payload
);
String
poduct
=
payload
.
getProduct
();
if
(
poduct
==
null
||
poduct
.
length
()
==
0
)
{
payload
.
set
Product
(
m_serverConfigManager
.
getDefaultProduct
());
payload
.
set
Action
(
Action
.
DASHBOARD
.
getName
());
}
m_normalizePayload
.
normalize
(
model
,
payload
);
int
timeRange
=
payload
.
getTimeRange
();
Date
startTime
=
new
Date
(
payload
.
getDate
()
-
(
timeRange
-
1
)
*
TimeUtil
.
ONE_HOUR
);
Date
endTime
=
new
Date
(
payload
.
getDate
()
+
TimeUtil
.
ONE_HOUR
-
1
);
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
5d6ba2e1
...
...
@@ -2854,9 +2854,6 @@
<requirement>
<role>
com.dianping.cat.report.page.metric.chart.GraphCreator
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.ServerConfigManager
</role>
</requirement>
</requirements>
</component>
<component>
...
...
cat-home/src/main/webapp/jsp/report/metric/metric.jsp
浏览文件 @
5d6ba2e1
...
...
@@ -54,6 +54,7 @@
</th>
</tr>
</table>
<div
class=
"row-fluid"
style=
"margin-top:2px;height:30px;"
></div>
<div
class=
"row-fluid"
>
<div
class=
"span2"
>
<div
class=
"well sidebar-nav"
>
...
...
cat-home/src/test/java/com/dianping/cat/AllTests.java
浏览文件 @
5d6ba2e1
...
...
@@ -107,8 +107,11 @@ ServiceReportMergerTest.class,
/* abtest */
GsonBuilderManagerTest
.
class
,
GroupStrategyParserTest
.
class
,
TrafficFilterTest
.
class
,
HeavyReportBuilderTest
.
class
})
public
class
AllTests
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录