Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
c8241e16
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,发现更多精彩内容 >>
提交
c8241e16
编写于
6月 20, 2013
作者:
Y
yong.you
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor cat api
上级
5cb523d9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
9 deletion
+21
-9
cat-consumer-advanced/src/main/java/com/dianping/cat/consumer/advanced/BussinessConfigManager.java
...ianping/cat/consumer/advanced/BussinessConfigManager.java
+4
-2
cat-consumer-advanced/src/test/resources/com/dianping/cat/consumer/model/metric-report.xml
...sources/com/dianping/cat/consumer/model/metric-report.xml
+1
-1
cat-core/src/main/java/com/dianping/cat/Cat.java
cat-core/src/main/java/com/dianping/cat/Cat.java
+14
-4
cat-home/src/main/java/com/dianping/cat/report/page/externalError/Handler.java
...a/com/dianping/cat/report/page/externalError/Handler.java
+2
-2
未找到文件。
cat-consumer-advanced/src/main/java/com/dianping/cat/consumer/advanced/BussinessConfigManager.java
浏览文件 @
c8241e16
...
@@ -31,8 +31,10 @@ public class BussinessConfigManager implements Initializable {
...
@@ -31,8 +31,10 @@ public class BussinessConfigManager implements Initializable {
for
(
String
domain
:
domains
)
{
for
(
String
domain
:
domains
)
{
Map
<
Integer
,
Map
<
String
,
BusinessConfig
>>
value
=
m_configs
.
get
(
domain
);
Map
<
Integer
,
Map
<
String
,
BusinessConfig
>>
value
=
m_configs
.
get
(
domain
);
for
(
Entry
<
Integer
,
Map
<
String
,
BusinessConfig
>>
internalEntry
:
value
.
entrySet
())
{
if
(
value
!=
null
){
configs
.
addAll
(
internalEntry
.
getValue
().
values
());
for
(
Entry
<
Integer
,
Map
<
String
,
BusinessConfig
>>
internalEntry
:
value
.
entrySet
())
{
configs
.
addAll
(
internalEntry
.
getValue
().
values
());
}
}
}
}
}
...
...
cat-consumer-advanced/src/test/resources/com/dianping/cat/consumer/model/metric-report.xml
浏览文件 @
c8241e16
<metric-report
product=
"TuanGou"
startTime=
"2012-02-16 23:00:00"
endTime=
"2012-02-16 23:59:00"
>
<metric-report
product=
"TuanGou"
startTime=
"2012-02-16 23:00:00"
endTime=
"2012-02-16 23:59:00"
>
<metric-item
id=
"addCount"
>
<metric-item
id=
"addCount"
type=
"S"
>
<domain>
TuanGouWeb
</domain>
<domain>
TuanGouWeb
</domain>
<domain>
TuanGouAPI
</domain>
<domain>
TuanGouAPI
</domain>
<abtest
run-id=
"0"
name=
"ALL"
>
<abtest
run-id=
"0"
name=
"ALL"
>
...
...
cat-core/src/main/java/com/dianping/cat/Cat.java
浏览文件 @
c8241e16
...
@@ -168,7 +168,17 @@ public class Cat {
...
@@ -168,7 +168,17 @@ public class Cat {
* the name of the metric
* the name of the metric
*/
*/
public
static
void
logMetricForCount
(
String
name
)
{
public
static
void
logMetricForCount
(
String
name
)
{
logMetricInternal
(
name
,
"C"
,
null
);
logMetricInternal
(
name
,
"C"
,
"1"
);
}
/**
* Increase the counter specified by <code>name</code> by one.
*
* @param name
* the name of the metric
*/
public
static
void
logMetricForCount
(
String
name
,
int
count
)
{
logMetricInternal
(
name
,
"C"
,
String
.
valueOf
(
count
));
}
}
/**
/**
...
@@ -206,11 +216,11 @@ public class Cat {
...
@@ -206,11 +216,11 @@ public class Cat {
* the quantity to be accumulated
* the quantity to be accumulated
*/
*/
public
static
void
logMetricForSum
(
String
name
,
double
sum
,
int
quantity
)
{
public
static
void
logMetricForSum
(
String
name
,
double
sum
,
int
quantity
)
{
logMetricInternal
(
name
,
"S"
,
String
.
format
(
"%.2f,%s"
,
sum
,
quantity
));
logMetricInternal
(
name
,
"S
,C
"
,
String
.
format
(
"%.2f,%s"
,
sum
,
quantity
));
}
}
static
void
logMetricInternal
(
String
name
,
String
type
,
String
keyValuePairs
)
{
static
void
logMetricInternal
(
String
name
,
String
status
,
String
keyValuePairs
)
{
Cat
.
getProducer
().
logMetric
(
name
,
type
,
keyValuePairs
);
Cat
.
getProducer
().
logMetric
(
name
,
status
,
keyValuePairs
);
}
}
public
static
<
T
>
T
lookup
(
Class
<
T
>
role
)
throws
ComponentLookupException
{
public
static
<
T
>
T
lookup
(
Class
<
T
>
role
)
throws
ComponentLookupException
{
...
...
cat-home/src/main/java/com/dianping/cat/report/page/externalError/Handler.java
浏览文件 @
c8241e16
...
@@ -71,9 +71,9 @@ public class Handler implements PageHandler<Context> {
...
@@ -71,9 +71,9 @@ public class Handler implements PageHandler<Context> {
event
.
setDate
(
new
Date
());
event
.
setDate
(
new
Date
());
try
{
try
{
event
.
setDate
(
new
Date
(
Integer
.
parseInt
(
time
)));
event
.
setDate
(
new
Date
(
Integer
.
parseInt
(
time
)));
}
catch
(
Exception
e
1
)
{
}
catch
(
Exception
e
x
)
{
event
.
setDate
(
new
Date
());
event
.
setDate
(
new
Date
());
Cat
.
logError
(
e
1
);
Cat
.
logError
(
e
x
);
}
}
}
}
m_errorCollectManager
.
addEvent
(
event
);
m_errorCollectManager
.
addEvent
(
event
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录