Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
8dd84115
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,发现更多精彩内容 >>
提交
8dd84115
编写于
4月 15, 2013
作者:
Y
yong.you
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix small issure
上级
1820ec5b
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
270 addition
and
33 deletion
+270
-33
cat-consumer/src/main/java/com/dianping/cat/consumer/RealtimeConsumer.java
...main/java/com/dianping/cat/consumer/RealtimeConsumer.java
+22
-20
cat-core/src/main/java/com/dianping/cat/message/io/DefaultMessageQueue.java
...java/com/dianping/cat/message/io/DefaultMessageQueue.java
+1
-11
cat-home/src/main/java/com/dianping/cat/report/ReportModule.java
...e/src/main/java/com/dianping/cat/report/ReportModule.java
+3
-1
cat-home/src/main/java/com/dianping/cat/report/ReportPage.java
...ome/src/main/java/com/dianping/cat/report/ReportPage.java
+3
-1
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Action.java
...n/java/com/dianping/cat/report/page/pushError/Action.java
+26
-0
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Context.java
.../java/com/dianping/cat/report/page/pushError/Context.java
+7
-0
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Handler.java
.../java/com/dianping/cat/report/page/pushError/Handler.java
+34
-0
cat-home/src/main/java/com/dianping/cat/report/page/pushError/JspFile.java
.../java/com/dianping/cat/report/page/pushError/JspFile.java
+17
-0
cat-home/src/main/java/com/dianping/cat/report/page/pushError/JspViewer.java
...ava/com/dianping/cat/report/page/pushError/JspViewer.java
+18
-0
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Model.java
...in/java/com/dianping/cat/report/page/pushError/Model.java
+26
-0
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Payload.java
.../java/com/dianping/cat/report/page/pushError/Payload.java
+105
-0
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
...home/src/main/resources/META-INF/wizard/webapp/wizard.xml
+3
-0
cat-home/src/main/webapp/jsp/report/pushError.jsp
cat-home/src/main/webapp/jsp/report/pushError.jsp
+5
-0
未找到文件。
cat-consumer/src/main/java/com/dianping/cat/consumer/RealtimeConsumer.java
浏览文件 @
8dd84115
...
...
@@ -80,6 +80,8 @@ public class RealtimeConsumer extends ContainerHolder implements MessageConsumer
private
long
m_networkError
;
private
static
int
QUEUE_SIZE
=
500000
;
@Override
public
void
consume
(
MessageTree
tree
)
{
try
{
...
...
@@ -212,7 +214,7 @@ public class RealtimeConsumer extends ContainerHolder implements MessageConsumer
for
(
String
name
:
m_analyzerNames
)
{
MessageAnalyzer
analyzer
=
m_factory
.
create
(
name
,
startTime
,
m_duration
,
m_extraTime
);
MessageQueue
queue
=
new
DefaultMessageQueue
();
MessageQueue
queue
=
new
DefaultMessageQueue
(
QUEUE_SIZE
);
PeriodTask
task
=
new
PeriodTask
(
m_factory
,
analyzer
,
queue
,
startTime
);
analyzers
.
put
(
name
,
analyzer
);
...
...
@@ -359,7 +361,6 @@ public class RealtimeConsumer extends ContainerHolder implements MessageConsumer
startPeriod
(
startTime
);
m_latch
.
countDown
();
try
{
while
(
m_active
)
{
try
{
long
now
=
System
.
currentTimeMillis
();
...
...
@@ -378,10 +379,11 @@ public class RealtimeConsumer extends ContainerHolder implements MessageConsumer
Cat
.
logError
(
e
);
}
try
{
Thread
.
sleep
(
1000L
);
}
}
catch
(
InterruptedException
e
)
{
// ignore it
break
;
}
}
}
...
...
cat-core/src/main/java/com/dianping/cat/message/io/DefaultMessageQueue.java
浏览文件 @
8dd84115
...
...
@@ -15,18 +15,8 @@ public class DefaultMessageQueue implements MessageQueue {
@Inject
private
int
m_size
;
private
static
final
int
SIZE
=
500000
;
public
DefaultMessageQueue
()
{
this
(
SIZE
);
}
public
DefaultMessageQueue
(
int
size
)
{
if
(
size
>
0
)
{
m_queue
=
new
LinkedBlockingQueue
<
MessageTree
>(
size
);
}
else
{
m_queue
=
new
LinkedBlockingQueue
<
MessageTree
>(
SIZE
);
}
}
@Override
...
...
cat-home/src/main/java/com/dianping/cat/report/ReportModule.java
浏览文件 @
8dd84115
...
...
@@ -47,7 +47,9 @@ com.dianping.cat.report.page.query.Handler.class,
com
.
dianping
.
cat
.
report
.
page
.
top
.
Handler
.
class
,
com
.
dianping
.
cat
.
report
.
page
.
metric
.
Handler
.
class
com
.
dianping
.
cat
.
report
.
page
.
metric
.
Handler
.
class
,
com
.
dianping
.
cat
.
report
.
page
.
pushError
.
Handler
.
class
})
public
class
ReportModule
extends
AbstractModule
{
...
...
cat-home/src/main/java/com/dianping/cat/report/ReportPage.java
浏览文件 @
8dd84115
...
...
@@ -45,7 +45,9 @@ public enum ReportPage implements Page {
TOP
(
"top"
,
"top"
,
"Top"
,
"Top"
,
true
),
METRIC
(
"metric"
,
"metric"
,
"Metric"
,
"Metric"
,
true
);
METRIC
(
"metric"
,
"metric"
,
"Metric"
,
"Metric"
,
true
),
PUSHERROR
(
"pushError"
,
"pushError"
,
"PushError"
,
"PushError"
,
true
);
private
String
m_name
;
...
...
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Action.java
0 → 100644
浏览文件 @
8dd84115
package
com.dianping.cat.report.page.pushError
;
public
enum
Action
implements
org
.
unidal
.
web
.
mvc
.
Action
{
VIEW
(
"view"
);
private
String
m_name
;
private
Action
(
String
name
)
{
m_name
=
name
;
}
public
static
Action
getByName
(
String
name
,
Action
defaultAction
)
{
for
(
Action
action
:
Action
.
values
())
{
if
(
action
.
getName
().
equals
(
name
))
{
return
action
;
}
}
return
defaultAction
;
}
@Override
public
String
getName
()
{
return
m_name
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Context.java
0 → 100644
浏览文件 @
8dd84115
package
com.dianping.cat.report.page.pushError
;
import
com.dianping.cat.report.ReportContext
;
public
class
Context
extends
ReportContext
<
Payload
>
{
}
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Handler.java
0 → 100644
浏览文件 @
8dd84115
package
com.dianping.cat.report.page.pushError
;
import
java.io.IOException
;
import
javax.servlet.ServletException
;
import
com.dianping.cat.report.ReportPage
;
import
org.unidal.lookup.annotation.Inject
;
import
org.unidal.web.mvc.PageHandler
;
import
org.unidal.web.mvc.annotation.InboundActionMeta
;
import
org.unidal.web.mvc.annotation.OutboundActionMeta
;
import
org.unidal.web.mvc.annotation.PayloadMeta
;
public
class
Handler
implements
PageHandler
<
Context
>
{
@Inject
private
JspViewer
m_jspViewer
;
@Override
@PayloadMeta
(
Payload
.
class
)
@InboundActionMeta
(
name
=
"pushError"
)
public
void
handleInbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
// display only, no action here
}
@Override
@OutboundActionMeta
(
name
=
"pushError"
)
public
void
handleOutbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
Model
model
=
new
Model
(
ctx
);
model
.
setAction
(
Action
.
VIEW
);
model
.
setPage
(
ReportPage
.
PUSHERROR
);
m_jspViewer
.
view
(
ctx
,
model
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/pushError/JspFile.java
0 → 100644
浏览文件 @
8dd84115
package
com.dianping.cat.report.page.pushError
;
public
enum
JspFile
{
VIEW
(
"/jsp/report/pushError.jsp"
),
;
private
String
m_path
;
private
JspFile
(
String
path
)
{
m_path
=
path
;
}
public
String
getPath
()
{
return
m_path
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/pushError/JspViewer.java
0 → 100644
浏览文件 @
8dd84115
package
com.dianping.cat.report.page.pushError
;
import
com.dianping.cat.report.ReportPage
;
import
org.unidal.web.mvc.view.BaseJspViewer
;
public
class
JspViewer
extends
BaseJspViewer
<
ReportPage
,
Action
,
Context
,
Model
>
{
@Override
protected
String
getJspFilePath
(
Context
ctx
,
Model
model
)
{
Action
action
=
model
.
getAction
();
switch
(
action
)
{
case
VIEW:
return
JspFile
.
VIEW
.
getPath
();
}
throw
new
RuntimeException
(
"Unknown action: "
+
action
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Model.java
0 → 100644
浏览文件 @
8dd84115
package
com.dianping.cat.report.page.pushError
;
import
com.dianping.cat.report.ReportPage
;
import
org.unidal.web.mvc.ViewModel
;
public
class
Model
extends
ViewModel
<
ReportPage
,
Action
,
Context
>
{
private
String
m_status
;
public
String
getStatus
()
{
return
m_status
;
}
public
void
setStatus
(
String
status
)
{
m_status
=
status
;
}
public
Model
(
Context
ctx
)
{
super
(
ctx
);
}
@Override
public
Action
getDefaultAction
()
{
return
Action
.
VIEW
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/pushError/Payload.java
0 → 100644
浏览文件 @
8dd84115
package
com.dianping.cat.report.page.pushError
;
import
com.dianping.cat.report.ReportPage
;
import
org.unidal.web.mvc.ActionContext
;
import
org.unidal.web.mvc.ActionPayload
;
import
org.unidal.web.mvc.payload.annotation.FieldMeta
;
public
class
Payload
implements
ActionPayload
<
ReportPage
,
Action
>
{
private
ReportPage
m_page
;
@FieldMeta
(
"op"
)
private
Action
m_action
;
@FieldMeta
(
"timestamp"
)
private
long
m_timestamp
;
@FieldMeta
(
"error"
)
private
String
m_error
;
@FieldMeta
(
"file"
)
private
String
m_file
;
@FieldMeta
(
"url"
)
private
String
m_url
;
@FieldMeta
(
"host"
)
private
String
m_host
;
@FieldMeta
(
"line"
)
private
String
m_line
;
public
void
setAction
(
String
action
)
{
m_action
=
Action
.
getByName
(
action
,
Action
.
VIEW
);
}
@Override
public
Action
getAction
()
{
return
m_action
;
}
@Override
public
ReportPage
getPage
()
{
return
m_page
;
}
@Override
public
void
setPage
(
String
page
)
{
m_page
=
ReportPage
.
getByName
(
page
,
ReportPage
.
PUSHERROR
);
}
public
long
getTimestamp
()
{
return
m_timestamp
;
}
public
void
setTimestamp
(
long
timestamp
)
{
m_timestamp
=
timestamp
;
}
public
String
getError
()
{
return
m_error
;
}
public
void
setError
(
String
error
)
{
m_error
=
error
;
}
public
String
getFile
()
{
return
m_file
;
}
public
void
setFile
(
String
file
)
{
m_file
=
file
;
}
public
String
getUrl
()
{
return
m_url
;
}
public
void
setUrl
(
String
url
)
{
m_url
=
url
;
}
public
String
getHost
()
{
return
m_host
;
}
public
void
setHost
(
String
host
)
{
m_host
=
host
;
}
public
String
getLine
()
{
return
m_line
;
}
public
void
setLine
(
String
line
)
{
m_line
=
line
;
}
@Override
public
void
validate
(
ActionContext
<?>
ctx
)
{
if
(
m_action
==
null
)
{
m_action
=
Action
.
VIEW
;
}
}
}
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
浏览文件 @
8dd84115
...
...
@@ -65,6 +65,9 @@
<page
name=
"metric"
title=
"Metric"
path=
"metric"
>
<description>
Metric
</description>
</page>
<page
name=
"pushError"
title=
"PushError"
path=
"pushError"
>
<description>
PushError
</description>
</page>
</module>
<module
name=
"system"
path=
"s"
default=
"false"
>
<page
name=
"alarm"
title=
"Alarm"
default=
"true"
path=
"alarm"
>
...
...
cat-home/src/main/webapp/jsp/report/pushError.jsp
0 → 100644
浏览文件 @
8dd84115
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.pushError.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.pushError.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.pushError.Model"
scope=
"request"
/>
View of pushError page under report
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录