Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
3746b0b7
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,发现更多精彩内容 >>
提交
3746b0b7
编写于
9月 29, 2014
作者:
L
leon.li
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change backend part for tag module
上级
9b769b1c
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
106 addition
and
17 deletion
+106
-17
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
...n/java/com/dianping/cat/build/ComponentsConfigurator.java
+3
-1
cat-home/src/main/java/com/dianping/cat/report/page/metric/graph/MetricGraphCreator.java
...ping/cat/report/page/metric/graph/MetricGraphCreator.java
+9
-3
cat-home/src/main/java/com/dianping/cat/system/config/TagManager.java
.../main/java/com/dianping/cat/system/config/TagManager.java
+16
-13
cat-home/src/main/java/com/dianping/cat/system/page/config/Payload.java
...ain/java/com/dianping/cat/system/page/config/Payload.java
+75
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+3
-0
未找到文件。
cat-home/src/main/java/com/dianping/cat/build/ComponentsConfigurator.java
浏览文件 @
3746b0b7
...
...
@@ -73,6 +73,7 @@ import com.dianping.cat.system.config.MetricGroupConfigManager;
import
com.dianping.cat.system.config.NetGraphConfigManager
;
import
com.dianping.cat.system.config.NetworkRuleConfigManager
;
import
com.dianping.cat.system.config.RouterConfigManager
;
import
com.dianping.cat.system.config.TagManager
;
import
com.dianping.cat.system.config.ThirdPartyConfigManager
;
import
com.dianping.cat.system.config.WebRuleConfigManager
;
...
...
@@ -186,7 +187,8 @@ public class ComponentsConfigurator extends AbstractResourceConfigurator {
MetricGroupConfigManager
.
class
,
AlertInfo
.
class
));
all
.
add
(
C
(
MetricGraphCreator
.
class
).
req
(
CachedMetricReportService
.
class
,
DataExtractor
.
class
,
MetricDataFetcher
.
class
).
req
(
BaselineService
.
class
,
MetricConfigManager
.
class
,
ProductLineConfigManager
.
class
,
MetricGroupConfigManager
.
class
,
AlertInfo
.
class
,
ProjectService
.
class
));
ProductLineConfigManager
.
class
,
MetricGroupConfigManager
.
class
,
AlertInfo
.
class
,
ProjectService
.
class
,
TagManager
.
class
));
all
.
add
(
C
(
SystemGraphCreator
.
class
).
req
(
CachedMetricReportService
.
class
,
DataExtractor
.
class
,
MetricDataFetcher
.
class
).
req
(
BaselineService
.
class
,
MetricConfigManager
.
class
,
ProductLineConfigManager
.
class
,
MetricGroupConfigManager
.
class
,
AlertInfo
.
class
));
...
...
cat-home/src/main/java/com/dianping/cat/report/page/metric/graph/MetricGraphCreator.java
浏览文件 @
3746b0b7
...
...
@@ -15,6 +15,7 @@ import org.unidal.lookup.annotation.Inject;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.advanced.metric.config.entity.MetricItemConfig
;
import
com.dianping.cat.advanced.metric.config.entity.Tag
;
import
com.dianping.cat.consumer.company.model.entity.ProductLine
;
import
com.dianping.cat.consumer.metric.model.entity.MetricReport
;
import
com.dianping.cat.core.dal.Project
;
...
...
@@ -270,11 +271,16 @@ public class MetricGraphCreator extends AbstractGraphCreator {
String
metricType
=
metric
.
getType
();
String
type
=
metricType
.
equalsIgnoreCase
(
"metric"
)
?
"Metric"
:
metricType
;
String
key
=
metric
.
getMetricKey
();
String
monitorTagType
=
metric
.
getMonitorTagType
();
String
id
=
m_metricConfigManager
.
buildMetricKey
(
domain
,
type
,
key
)
+
":"
+
monitorTagType
;
for
(
Tag
metricTag
:
metric
.
getTags
())
{
if
(
tag
.
equals
(
metricTag
.
getName
()))
{
String
tagType
=
metricTag
.
getType
();
String
id
=
m_metricConfigManager
.
buildMetricKey
(
domain
,
type
,
key
)
+
":"
+
tagType
;
put
(
allCharts
,
result
,
id
);
}
}
}
return
result
;
}
...
...
cat-home/src/main/java/com/dianping/cat/system/config/TagManager.java
浏览文件 @
3746b0b7
...
...
@@ -11,6 +11,7 @@ import org.unidal.lookup.annotation.Inject;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.advanced.metric.config.entity.MetricItemConfig
;
import
com.dianping.cat.advanced.metric.config.entity.Tag
;
import
com.dianping.cat.consumer.metric.MetricConfigManager
;
public
class
TagManager
{
...
...
@@ -22,14 +23,14 @@ public class TagManager {
Set
<
String
>
tags
=
new
HashSet
<
String
>();
try
{
Collection
<
MetricItemConfig
>
configs
=
m_metricConfigManager
.
getMetricConfig
().
getMetricItemConfigs
()
.
values
();
Collection
<
MetricItemConfig
>
configs
=
m_metricConfigManager
.
getMetricConfig
().
getMetricItemConfigs
().
values
();
for
(
MetricItemConfig
metricItemConfig
:
configs
)
{
String
tag
=
metricItemConfig
.
getTag
();
if
(!
StringUtil
.
isEmpty
(
tag
))
{
tags
.
add
(
tag
);
for
(
Tag
tag
:
metricItemConfig
.
getTags
())
{
String
tagName
=
tag
.
getName
();
if
(!
StringUtil
.
isEmpty
(
tagName
))
{
tags
.
add
(
tagName
);
}
}
}
}
catch
(
Exception
ex
)
{
...
...
@@ -42,14 +43,16 @@ public class TagManager {
List
<
MetricItemConfig
>
metricItemConfigs
=
new
ArrayList
<
MetricItemConfig
>();
try
{
Collection
<
MetricItemConfig
>
configs
=
m_metricConfigManager
.
getMetricConfig
().
getMetricItemConfigs
()
.
values
();
Collection
<
MetricItemConfig
>
configs
=
m_metricConfigManager
.
getMetricConfig
().
getMetricItemConfigs
().
values
();
for
(
MetricItemConfig
metricItemConfig
:
configs
)
{
String
itemTag
=
metricItemConfig
.
getTag
();
for
(
Tag
itemTag
:
metricItemConfig
.
getTags
())
{
String
tagName
=
itemTag
.
getName
();
if
(
tag
.
equals
(
itemTag
))
{
if
(
tag
.
equals
(
tagName
))
{
metricItemConfigs
.
add
(
metricItemConfig
);
break
;
}
}
}
}
catch
(
Exception
ex
)
{
...
...
cat-home/src/main/java/com/dianping/cat/system/page/config/Payload.java
浏览文件 @
3746b0b7
package
com.dianping.cat.system.page.config
;
import
java.util.List
;
import
org.hsqldb.lib.StringUtil
;
import
org.unidal.web.mvc.ActionContext
;
import
org.unidal.web.mvc.ActionPayload
;
import
org.unidal.web.mvc.payload.annotation.FieldMeta
;
...
...
@@ -7,6 +10,7 @@ import org.unidal.web.mvc.payload.annotation.ObjectMeta;
import
com.dianping.cat.Constants
;
import
com.dianping.cat.advanced.metric.config.entity.MetricItemConfig
;
import
com.dianping.cat.advanced.metric.config.entity.Tag
;
import
com.dianping.cat.configuration.aggreation.model.entity.AggregationRule
;
import
com.dianping.cat.configuration.url.pattern.entity.PatternItem
;
import
com.dianping.cat.consumer.company.model.entity.ProductLine
;
...
...
@@ -104,6 +108,15 @@ public class Payload implements ActionPayload<SystemPage, Action> {
@FieldMeta
(
"configs"
)
private
String
m_configs
;
@FieldMeta
(
"countTags"
)
private
String
m_countTags
;
@FieldMeta
(
"avgTags"
)
private
String
m_avgTags
;
@FieldMeta
(
"sumTags"
)
private
String
m_sumTags
;
@Override
public
Action
getAction
()
{
if
(
m_action
==
null
)
{
...
...
@@ -116,6 +129,10 @@ public class Payload implements ActionPayload<SystemPage, Action> {
return
m_allOnOrOff
;
}
public
String
getAvgTags
()
{
return
m_avgTags
;
}
public
String
getBug
()
{
return
m_bug
;
}
...
...
@@ -128,6 +145,10 @@ public class Payload implements ActionPayload<SystemPage, Action> {
return
m_content
;
}
public
String
getCoungTags
()
{
return
m_countTags
;
}
public
String
getDomain
()
{
return
m_domain
;
}
...
...
@@ -169,6 +190,44 @@ public class Payload implements ActionPayload<SystemPage, Action> {
}
public
MetricItemConfig
getMetricItemConfig
()
{
List
<
Tag
>
tags
=
m_metricItemConfig
.
getTags
();
if
(!
StringUtil
.
isEmpty
(
m_countTags
))
{
for
(
String
tag
:
m_countTags
.
split
(
","
))
{
tag
=
tag
.
trim
();
if
(!
StringUtil
.
isEmpty
(
tag
))
{
Tag
countTag
=
new
Tag
();
countTag
.
setName
(
tag
).
setType
(
"COUNT"
);
tags
.
add
(
countTag
);
}
}
}
if
(!
StringUtil
.
isEmpty
(
m_sumTags
))
{
for
(
String
tag
:
m_sumTags
.
split
(
","
))
{
tag
=
tag
.
trim
();
if
(!
StringUtil
.
isEmpty
(
tag
))
{
Tag
sumTag
=
new
Tag
();
sumTag
.
setName
(
tag
).
setType
(
"SUM"
);
tags
.
add
(
sumTag
);
}
}
}
if
(!
StringUtil
.
isEmpty
(
m_avgTags
))
{
for
(
String
tag
:
m_avgTags
.
split
(
","
))
{
tag
=
tag
.
trim
();
if
(!
StringUtil
.
isEmpty
(
tag
))
{
Tag
avgTag
=
new
Tag
();
avgTag
.
setName
(
tag
).
setType
(
"AVG"
);
tags
.
add
(
avgTag
);
}
}
}
return
m_metricItemConfig
;
}
...
...
@@ -224,6 +283,10 @@ public class Payload implements ActionPayload<SystemPage, Action> {
return
m_ruleId
;
}
public
String
getSumTags
()
{
return
m_sumTags
;
}
public
String
getTo
()
{
return
m_to
;
}
...
...
@@ -240,6 +303,10 @@ public class Payload implements ActionPayload<SystemPage, Action> {
m_allOnOrOff
=
allOnOrOff
;
}
public
void
setAvgTags
(
String
avgTags
)
{
m_avgTags
=
avgTags
;
}
public
void
setBug
(
String
bug
)
{
m_bug
=
bug
;
}
...
...
@@ -252,6 +319,10 @@ public class Payload implements ActionPayload<SystemPage, Action> {
m_content
=
content
;
}
public
void
setCoungTags
(
String
coungTags
)
{
m_countTags
=
coungTags
;
}
public
void
setDomain
(
String
domain
)
{
m_domain
=
domain
;
}
...
...
@@ -337,6 +408,10 @@ public class Payload implements ActionPayload<SystemPage, Action> {
m_ruleId
=
ruleId
;
}
public
void
setSumTags
(
String
sumTags
)
{
m_sumTags
=
sumTags
;
}
public
void
setTo
(
String
to
)
{
m_to
=
to
;
}
...
...
cat-home/src/main/resources/META-INF/plexus/components.xml
浏览文件 @
3746b0b7
...
...
@@ -342,6 +342,9 @@
<requirement>
<role>
com.dianping.cat.service.ProjectService
</role>
</requirement>
<requirement>
<role>
com.dianping.cat.system.config.TagManager
</role>
</requirement>
</requirements>
</component>
<component>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录