Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
c671cf09
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,发现更多精彩内容 >>
提交
c671cf09
编写于
7月 24, 2012
作者:
Y
You Yong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the log and arrays coopy
上级
0b21d7c0
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
253 addition
and
177 deletion
+253
-177
cat-core/src/main/java/com/dianping/cat/message/internal/DefaultMessageManager.java
.../dianping/cat/message/internal/DefaultMessageManager.java
+15
-7
cat-core/src/main/java/com/dianping/cat/message/io/TcpSocketHierarchySender.java
...com/dianping/cat/message/io/TcpSocketHierarchySender.java
+11
-5
cat-core/src/main/java/com/dianping/cat/message/io/TcpSocketReceiver.java
...n/java/com/dianping/cat/message/io/TcpSocketReceiver.java
+1
-14
cat-core/src/main/java/com/dianping/cat/message/io/TcpSocketSender.java
...ain/java/com/dianping/cat/message/io/TcpSocketSender.java
+13
-7
cat-core/src/main/java/com/dianping/cat/message/spi/AbstractMessageAnalyzer.java
...com/dianping/cat/message/spi/AbstractMessageAnalyzer.java
+10
-2
cat-home/src/main/java/com/dianping/cat/report/graph/MobileGraphItem.java
...n/java/com/dianping/cat/report/graph/MobileGraphItem.java
+17
-3
cat-home/src/main/java/com/dianping/cat/report/page/heartbeat/DisplayHeartbeat.java
.../dianping/cat/report/page/heartbeat/DisplayHeartbeat.java
+9
-4
cat-home/src/main/java/com/dianping/cat/report/page/heatmap/Handler.java
...in/java/com/dianping/cat/report/page/heatmap/Handler.java
+7
-2
cat-home/src/main/java/com/dianping/cat/report/page/logview/Payload.java
...in/java/com/dianping/cat/report/page/logview/Payload.java
+7
-1
cat-home/src/main/java/com/dianping/cat/report/page/model/Payload.java
...main/java/com/dianping/cat/report/page/model/Payload.java
+32
-26
cat-home/src/main/java/com/dianping/cat/report/page/trend/GraphItem.java
...in/java/com/dianping/cat/report/page/trend/GraphItem.java
+6
-1
cat-home/src/main/resources/META-INF/cat/client.xml
cat-home/src/main/resources/META-INF/cat/client.xml
+0
-3
cat-home/src/main/webapp/WEB-INF/webres.tld
cat-home/src/main/webapp/WEB-INF/webres.tld
+98
-98
cat-home/src/test/java/com/dianping/cat/demo/Demo.java
cat-home/src/test/java/com/dianping/cat/demo/Demo.java
+1
-2
cat-home/src/test/java/com/dianping/cat/demo/TestSendMessage.java
.../src/test/java/com/dianping/cat/demo/TestSendMessage.java
+21
-0
cat-job/src/main/java/com/dianping/cat/job/spi/joblet/JobletRunner.java
...in/java/com/dianping/cat/job/spi/joblet/JobletRunner.java
+5
-2
未找到文件。
cat-core/src/main/java/com/dianping/cat/message/internal/DefaultMessageManager.java
浏览文件 @
c671cf09
...
...
@@ -35,6 +35,8 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
private
MessageIdFactory
m_factory
;
private
long
m_throttleTimes
=
9999
;
// we don't use static modifier since MessageManager is a singleton in
// production actually
private
ThreadLocal
<
Context
>
m_context
=
new
ThreadLocal
<
Context
>()
{
...
...
@@ -86,6 +88,12 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
if
(
m_statistics
!=
null
)
{
m_statistics
.
onSending
(
tree
);
}
}
else
{
m_throttleTimes
++;
if
(
m_throttleTimes
%
10000
==
0
)
{
m_logger
.
info
(
"Cat Message is throttled! Times:"
+
m_throttleTimes
);
}
}
}
...
...
@@ -175,18 +183,18 @@ public class DefaultMessageManager extends ContainerHolder implements MessageMan
m_context
.
set
(
ctx
);
}
boolean
shouldThrottle
(
MessageTree
tree
)
{
private
boolean
shouldThrottle
(
MessageTree
tree
)
{
if
(!
isCatEnabled
())
{
return
true
;
}
if
(
tree
.
getMessage
()
!=
null
&&
"Heartbeat"
.
equals
(
tree
.
getMessage
().
getName
()))
{
return
false
;
}
return
false
;
//int threadCount = ManagementFactory.getThreadMXBean().getThreadCount();
//return threadCount > m_domain.getMaxThreads();
//if (tree.getMessage() != null && "Heartbeat".equals(tree.getMessage().getName())) {
// return false;
//}
// int threadCount = ManagementFactory.getThreadMXBean().getThreadCount();
// return threadCount > m_domain.getMaxThreads();
}
@Override
...
...
cat-core/src/main/java/com/dianping/cat/message/io/TcpSocketHierarchySender.java
浏览文件 @
c671cf09
...
...
@@ -49,9 +49,9 @@ public class TcpSocketHierarchySender implements Task, MessageSender, LogEnabled
private
transient
boolean
m_active
;
private
AtomicInteger
m_errors
=
new
AtomicInteger
();
private
AtomicInteger
m_errors
=
new
AtomicInteger
(
999
);
private
AtomicInteger
m_attempts
=
new
AtomicInteger
();
private
AtomicInteger
m_attempts
=
new
AtomicInteger
(
999
);
boolean
checkWritable
(
ChannelFuture
future
)
{
boolean
isWriteable
=
false
;
...
...
@@ -62,7 +62,7 @@ public class TcpSocketHierarchySender implements Task, MessageSender, LogEnabled
}
else
{
int
count
=
m_attempts
.
incrementAndGet
();
if
(
count
%
100
==
0
)
{
if
(
count
%
100
0
==
0
)
{
m_logger
.
error
(
"Netty write buffer is full! Attempts: "
+
count
);
}
}
...
...
@@ -131,7 +131,7 @@ public class TcpSocketHierarchySender implements Task, MessageSender, LogEnabled
int
count
=
m_errors
.
incrementAndGet
();
if
(
count
%
100
==
0
)
{
if
(
count
%
100
0
==
0
)
{
m_logger
.
error
(
"Message queue is full in tcp socket sender! Count: "
+
count
);
}
}
...
...
@@ -183,6 +183,8 @@ public class TcpSocketHierarchySender implements Task, MessageSender, LogEnabled
private
boolean
m_active
=
true
;
private
AtomicInteger
m_reconnects
=
new
AtomicInteger
(
999
);
public
ChannelManager
(
Logger
logger
,
List
<
InetSocketAddress
>
serverAddresses
)
{
int
len
=
serverAddresses
.
size
();
...
...
@@ -225,7 +227,11 @@ public class TcpSocketHierarchySender implements Task, MessageSender, LogEnabled
if
(!
future
.
isSuccess
())
{
future
.
getChannel
().
getCloseFuture
().
awaitUninterruptibly
();
m_logger
.
error
(
"Error when try to connecting to "
+
address
+
", message: "
+
future
.
getCause
());
int
count
=
m_reconnects
.
incrementAndGet
();
if
(
count
%
1000
==
0
)
{
m_logger
.
error
(
"Error when try to connecting to "
+
address
+
", message: "
+
future
.
getCause
());
}
return
null
;
}
else
{
m_logger
.
info
(
"Connected to CAT server at "
+
address
);
...
...
cat-core/src/main/java/com/dianping/cat/message/io/TcpSocketReceiver.java
浏览文件 @
c671cf09
...
...
@@ -175,27 +175,14 @@ public class TcpSocketReceiver implements MessageReceiver, LogEnabled {
buffer
.
resetReaderIndex
();
return
null
;
}
return
buffer
.
readBytes
(
length
);
}
}
class
MyHandler
extends
SimpleChannelHandler
{
@Override
public
void
channelConnected
(
ChannelHandlerContext
ctx
,
ChannelStateEvent
event
)
throws
Exception
{
super
.
channelConnected
(
ctx
,
event
);
m_logger
.
info
(
"Socket client from "
+
event
.
getChannel
().
getRemoteAddress
()
+
" CONNECTED!"
);
}
@Override
public
void
channelDisconnected
(
ChannelHandlerContext
ctx
,
ChannelStateEvent
event
)
throws
Exception
{
super
.
channelDisconnected
(
ctx
,
event
);
m_logger
.
info
(
"Socket client from "
+
event
.
getChannel
().
getRemoteAddress
()
+
" DISCONNECTED!"
);
}
@Override
public
void
channelOpen
(
ChannelHandlerContext
ctx
,
ChannelStateEvent
event
)
throws
Exception
{
super
.
channelOpen
(
ctx
,
event
);
m_channelGroup
.
add
(
event
.
getChannel
());
}
...
...
cat-core/src/main/java/com/dianping/cat/message/io/TcpSocketSender.java
浏览文件 @
c671cf09
...
...
@@ -54,9 +54,11 @@ public class TcpSocketSender implements Task, MessageSender, LogEnabled {
private
transient
boolean
m_active
;
private
AtomicInteger
m_errors
=
new
AtomicInteger
();
private
AtomicInteger
m_errors
=
new
AtomicInteger
(
999
);
private
AtomicInteger
m_attempts
=
new
AtomicInteger
();
private
AtomicInteger
m_attempts
=
new
AtomicInteger
(
999
);
private
AtomicInteger
m_reconnects
=
new
AtomicInteger
(
999
);
@Override
public
void
enableLogging
(
Logger
logger
)
{
...
...
@@ -114,7 +116,11 @@ public class TcpSocketSender implements Task, MessageSender, LogEnabled {
future
.
awaitUninterruptibly
();
if
(!
future
.
isSuccess
())
{
//m_logger.error("Error when reconnecting to " + m_serverAddress, future.getCause());
int
count
=
m_reconnects
.
incrementAndGet
();
if
(
count
%
1000
==
0
)
{
m_logger
.
error
(
"Error when reconnecting to "
+
m_serverAddress
,
future
.
getCause
());
}
}
else
{
m_future
=
future
;
m_logger
.
info
(
"Reconnected to CAT server at "
+
m_serverAddress
);
...
...
@@ -141,7 +147,7 @@ public class TcpSocketSender implements Task, MessageSender, LogEnabled {
}
catch
(
Exception
e
)
{
break
;
}
if
(
m_future
==
null
||
!
m_future
.
getChannel
().
isOpen
())
{
reconnect
();
}
...
...
@@ -169,8 +175,8 @@ public class TcpSocketSender implements Task, MessageSender, LogEnabled {
}
else
{
int
count
=
m_attempts
.
incrementAndGet
();
if
(
count
%
100
==
0
)
{
m_logger
.
error
(
"
Can't send message to cat-server due to Netty write buffer full! Count
: "
+
count
);
if
(
count
%
100
0
==
0
)
{
m_logger
.
error
(
"
Netty write buffer is full! Attempts
: "
+
count
);
}
}
}
...
...
@@ -189,7 +195,7 @@ public class TcpSocketSender implements Task, MessageSender, LogEnabled {
int
count
=
m_errors
.
incrementAndGet
();
if
(
count
%
100
==
0
)
{
if
(
count
%
100
0
==
0
)
{
m_logger
.
error
(
"Message queue is full in tcp socket sender! Count: "
+
count
);
}
}
...
...
cat-core/src/main/java/com/dianping/cat/message/spi/AbstractMessageAnalyzer.java
浏览文件 @
c671cf09
...
...
@@ -8,6 +8,8 @@ public abstract class AbstractMessageAnalyzer<R> extends ContainerHolder impleme
protected
static
final
long
MINUTE
=
60
*
1000
;
private
long
m_errors
=
9999
;
@Override
public
void
analyze
(
MessageQueue
queue
)
{
while
(!
isTimeout
()
&&
isActive
())
{
...
...
@@ -17,7 +19,10 @@ public abstract class AbstractMessageAnalyzer<R> extends ContainerHolder impleme
try
{
process
(
tree
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
m_errors
++;
if
(
m_errors
%
10000
==
0
)
{
e
.
printStackTrace
();
}
}
}
}
...
...
@@ -29,7 +34,10 @@ public abstract class AbstractMessageAnalyzer<R> extends ContainerHolder impleme
try
{
process
(
tree
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
m_errors
++;
if
(
m_errors
%
10000
==
0
)
{
e
.
printStackTrace
();
}
}
}
else
{
break
;
...
...
cat-home/src/main/java/com/dianping/cat/report/graph/MobileGraphItem.java
浏览文件 @
c671cf09
package
com.dianping.cat.report.graph
;
import
java.util.Arrays
;
public
class
MobileGraphItem
{
private
String
[]
m_xlabel
;
...
...
@@ -26,17 +28,29 @@ public class MobileGraphItem {
}
public
MobileGraphItem
setXlabel
(
String
[]
xlabel
)
{
m_xlabel
=
xlabel
;
if
(
xlabel
==
null
)
{
m_xlabel
=
new
String
[
0
];
}
else
{
m_xlabel
=
Arrays
.
copyOf
(
xlabel
,
xlabel
.
length
);
}
return
this
;
}
public
MobileGraphItem
setYlable
(
double
[]
ylable
)
{
m_ylable
=
ylable
;
if
(
ylable
==
null
)
{
m_ylable
=
new
double
[
0
];
}
else
{
m_ylable
=
Arrays
.
copyOf
(
ylable
,
ylable
.
length
);
}
return
this
;
}
public
MobileGraphItem
setValue
(
double
[]
value
)
{
m_value
=
value
;
if
(
value
==
null
)
{
m_value
=
new
double
[
0
];
}
else
{
m_value
=
Arrays
.
copyOf
(
value
,
value
.
length
);
}
return
this
;
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/heartbeat/DisplayHeartbeat.java
浏览文件 @
c671cf09
package
com.dianping.cat.report.page.heartbeat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
com.dianping.cat.consumer.heartbeat.model.entity.Disk
;
...
...
@@ -26,7 +27,7 @@ public class DisplayHeartbeat {
private
double
[]
m_catThreads
=
new
double
[
60
];
private
double
[]
m_pigeonThreads
=
new
double
[
60
];
private
double
[]
m_httpThreads
=
new
double
[
60
];
private
double
[]
m_catMessageProduced
=
new
double
[
60
];
...
...
@@ -159,7 +160,7 @@ public class DisplayHeartbeat {
public
double
[]
getAddOldGcCount
()
{
return
m_addOldGcCount
;
}
public
GraphBuilder
getBuilder
()
{
return
m_builder
;
}
...
...
@@ -350,7 +351,7 @@ public class DisplayHeartbeat {
public
String
getStartedThreadGraph
()
{
return
m_builder
.
build
(
new
HeartbeatPayload
(
1
,
"Started Thread"
,
"Minute"
,
"Count"
,
m_newThreads
));
}
public
double
[]
getSystemLoadAverage
()
{
return
m_systemLoadAverage
;
}
...
...
@@ -387,7 +388,11 @@ public class DisplayHeartbeat {
m_labels
[
i
]
=
String
.
valueOf
(
i
);
}
m_values
=
values
;
if
(
values
==
null
)
{
m_values
=
new
double
[
0
];
}
else
{
m_values
=
Arrays
.
copyOf
(
values
,
values
.
length
);
}
}
@Override
...
...
cat-home/src/main/java/com/dianping/cat/report/page/heatmap/Handler.java
浏览文件 @
c671cf09
...
...
@@ -2,6 +2,7 @@ package com.dianping.cat.report.page.heatmap;
import
java.io.IOException
;
import
java.text.DecimalFormat
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -86,7 +87,7 @@ public class Handler implements PageHandler<Context> {
if
(
payload
.
getPeriod
().
isCurrent
())
{
payload
.
setStep
(
payload
.
getStep
()
-
1
);
}
model
.
setDisplay
(
payload
.
getDisplay
());
model
.
setAction
(
action
);
model
.
setPage
(
ReportPage
.
HEATMAP
);
...
...
@@ -191,11 +192,15 @@ public class Handler implements PageHandler<Context> {
private
double
m_lng1
;
public
Result
(
int
[][]
matrix
,
double
lat1
,
double
lng1
,
double
latUnit
,
double
lngUnit
)
{
m_matrix
=
matrix
;
m_lat1
=
lat1
;
m_lng1
=
lng1
;
m_latUnit
=
latUnit
;
m_lngUnit
=
lngUnit
;
if
(
matrix
==
null
)
{
m_matrix
=
new
int
[
0
][
0
];
}
else
{
m_matrix
=
Arrays
.
copyOf
(
matrix
,
matrix
.
length
);
}
}
public
int
getMax
()
{
...
...
cat-home/src/main/java/com/dianping/cat/report/page/logview/Payload.java
浏览文件 @
c671cf09
package
com.dianping.cat.report.page.logview
;
import
java.util.Arrays
;
import
com.dianping.cat.report.ReportPage
;
import
com.dianping.cat.report.page.AbstractReportPayload
;
import
com.site.web.mvc.ActionContext
;
...
...
@@ -67,7 +69,11 @@ public class Payload extends AbstractReportPayload<Action> {
}
public
void
setPath
(
String
[]
path
)
{
m_path
=
path
;
if
(
path
==
null
)
{
m_path
=
new
String
[
0
];
}
else
{
m_path
=
Arrays
.
copyOf
(
path
,
path
.
length
);
}
}
public
void
setShowHeader
(
String
showHeader
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/page/model/Payload.java
浏览文件 @
c671cf09
package
com.dianping.cat.report.page.model
;
import
java.util.Arrays
;
import
com.dianping.cat.report.ReportPage
;
import
com.dianping.cat.report.page.model.spi.ModelPeriod
;
import
com.site.web.mvc.ActionContext
;
...
...
@@ -28,16 +30,16 @@ public class Payload implements ActionPayload<ReportPage, Action> {
@FieldMeta
(
"thread"
)
private
String
m_threadId
;
@FieldMeta
(
"messageId"
)
private
String
m_messageId
;
@FieldMeta
(
"tag"
)
private
String
m_tag
;
@FieldMeta
(
"direction"
)
private
String
m_direction
;
@Override
public
Action
getAction
()
{
return
m_action
;
...
...
@@ -52,8 +54,8 @@ public class Payload implements ActionPayload<ReportPage, Action> {
}
public
String
getIpAddress
()
{
return
m_ipAddress
;
}
return
m_ipAddress
;
}
public
String
getName
()
{
return
m_name
;
...
...
@@ -81,8 +83,8 @@ public class Payload implements ActionPayload<ReportPage, Action> {
}
public
String
getThreadId
()
{
return
m_threadId
;
}
return
m_threadId
;
}
public
String
getType
()
{
return
m_type
;
...
...
@@ -93,8 +95,8 @@ public class Payload implements ActionPayload<ReportPage, Action> {
}
public
void
setIpAddress
(
String
ipAddress
)
{
m_ipAddress
=
ipAddress
;
}
m_ipAddress
=
ipAddress
;
}
public
void
setName
(
String
name
)
{
m_name
=
name
;
...
...
@@ -106,40 +108,44 @@ public class Payload implements ActionPayload<ReportPage, Action> {
}
public
void
setPath
(
String
[]
path
)
{
m_path
=
path
;
if
(
path
==
null
)
{
m_path
=
new
String
[
0
];
}
else
{
m_path
=
Arrays
.
copyOf
(
path
,
path
.
length
);
}
}
public
void
setThreadId
(
String
threadId
)
{
m_threadId
=
threadId
;
}
m_threadId
=
threadId
;
}
public
void
setType
(
String
type
)
{
m_type
=
type
;
}
public
String
getMessageId
()
{
return
m_messageId
;
}
return
m_messageId
;
}
public
void
setMessageId
(
String
messageId
)
{
m_messageId
=
messageId
;
}
m_messageId
=
messageId
;
}
public
String
getTag
()
{
return
m_tag
;
}
return
m_tag
;
}
public
void
setTag
(
String
tag
)
{
m_tag
=
tag
;
}
m_tag
=
tag
;
}
public
String
getDirection
()
{
return
m_direction
;
}
return
m_direction
;
}
public
void
setDirection
(
String
direction
)
{
m_direction
=
direction
;
}
m_direction
=
direction
;
}
@Override
public
void
validate
(
ActionContext
<?>
ctx
)
{
...
...
cat-home/src/main/java/com/dianping/cat/report/page/trend/GraphItem.java
浏览文件 @
c671cf09
...
...
@@ -2,6 +2,7 @@ package com.dianping.cat.report.page.trend;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -65,7 +66,11 @@ public class GraphItem {
}
public
void
setYlable
(
double
[]
ylable
)
{
this
.
ylable
=
ylable
;
if
(
ylable
==
null
)
{
this
.
ylable
=
new
double
[
0
];
}
else
{
this
.
ylable
=
Arrays
.
copyOf
(
ylable
,
ylable
.
length
);
}
}
public
String
getTitles
()
{
...
...
cat-home/src/main/resources/META-INF/cat/client.xml
浏览文件 @
c671cf09
<config
mode=
"client"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema"
xsi:noNamespaceSchemaLocation=
"config.xsd"
>
<servers>
<server
ip=
"127.0.0.1"
port=
"2280"
/>
</servers>
<domain
id=
"Cat"
/>
</config>
cat-home/src/main/webapp/WEB-INF/webres.tld
浏览文件 @
c671cf09
...
...
@@ -4,23 +4,9 @@
<short-name>res</short-name>
<uri>http://www.unidal.org/webres</uri>
<tag>
<description><![CDATA[Resource Bean Tag to define resource bean variable as bootstrap]]></description>
<name>bean</name>
<tag-class>org.unidal.webres.taglib.basic.BeanTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[A valid id for Bean.]]></description>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[cssSlot Resource Tag]]></description>
<name>cssSlot</name>
<tag-class>org.unidal.webres.taglib.basic.CssSlotTagHandler</tag-class>
<description><![CDATA[jsSlot Resource Tag]]></description>
<name>jsSlot</name>
<tag-class>org.unidal.webres.taglib.basic.JsSlotTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
...
...
@@ -30,7 +16,7 @@
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for
Cs
sSlot.]]></description>
<description><![CDATA[The reference id for
J
sSlot.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
...
...
@@ -46,26 +32,40 @@
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[
Image Resource Tag
]]></description>
<name>
img
</name>
<tag-class>org.unidal.webres.taglib.basic.
Image
TagHandler</tag-class>
<description><![CDATA[
Resource Bean Tag to define resource bean variable as bootstrap
]]></description>
<name>
bean
</name>
<tag-class>org.unidal.webres.taglib.basic.
Bean
TagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[
The value for image, could be a expression or a image path
.]]></description>
<name>
value
</name>
<description><![CDATA[
A valid id for Bean
.]]></description>
<name>
id
</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[useCss Resource Tag]]></description>
<name>useCss</name>
<tag-class>org.unidal.webres.taglib.basic.UseCssTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Set the css value with EL or a css ref.]]></description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Identify whether the
image
URL is secure or not.]]></description>
<description><![CDATA[Identify whether the
link
URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for
img
.]]></description>
<description><![CDATA[The reference id for
Css
.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
...
...
@@ -78,45 +78,66 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Target placement for this css resource to render]]></description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[
jsSlot Resource Tag
]]></description>
<name>
jsSlot
</name>
<tag-class>org.unidal.webres.taglib.basic.
JsSlot
TagHandler</tag-class>
<description><![CDATA[
Resource token tag for page resources
]]></description>
<name>
token
</name>
<tag-class>org.unidal.webres.taglib.basic.
Token
TagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[
Identify whether the link URL is secure or not.
]]></description>
<name>
secur
e</name>
<description><![CDATA[
Customized tag render type
]]></description>
<name>
renderTyp
e</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>
boolean
</type>
<type>
java.lang.String
</type>
</attribute>
<attribute>
<description><![CDATA[T
he reference id for JsSlot.
]]></description>
<name>
id
</name>
<required>
fals
e</required>
<description><![CDATA[T
oken type of resource: js, css
]]></description>
<name>
type
</name>
<required>
tru
e</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Set tag to define a page attribute with id as name]]></description>
<name>set</name>
<tag-class>org.unidal.webres.taglib.basic.SetTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<description><![CDATA[The value]]></description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[The name.]]></description>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>
tru
e</dynamic-attributes>
<dynamic-attributes>
fals
e</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[
Link
Resource Tag]]></description>
<name>
link
</name>
<tag-class>org.unidal.webres.taglib.basic.
Link
TagHandler</tag-class>
<description><![CDATA[
useJs
Resource Tag]]></description>
<name>
useJs
</name>
<tag-class>org.unidal.webres.taglib.basic.
UseJs
TagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[
The value for link, could be a expression or a link
ref.]]></description>
<description><![CDATA[
Set the js value with EL or a js
ref.]]></description>
<name>value</name>
<required>
tru
e</required>
<required>
fals
e</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
...
...
@@ -128,40 +149,47 @@
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for Js.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Target placement for this js resource to render]]></description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[
Set tag to define a page attribute with id as name
]]></description>
<name>
set
</name>
<tag-class>org.unidal.webres.taglib.basic.
Set
TagHandler</tag-class>
<description><![CDATA[
Link Resource Tag
]]></description>
<name>
link
</name>
<tag-class>org.unidal.webres.taglib.basic.
Link
TagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[The value]]></description>
<description><![CDATA[The value
for link, could be a expression or a link ref.
]]></description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[
The name
.]]></description>
<name>
id
</name>
<required>
tru
e</required>
<description><![CDATA[
Identify whether the link URL is secure or not
.]]></description>
<name>
secure
</name>
<required>
fals
e</required>
<rtexprvalue>true</rtexprvalue>
<type>
java.lang.String
</type>
<type>
boolean
</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Resource token tag for page resources]]></description>
<name>token</name>
<tag-class>org.unidal.webres.taglib.basic.TokenTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
...
...
@@ -169,36 +197,29 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Token type of resource: js, css]]></description>
<name>type</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[
useCss
Resource Tag]]></description>
<name>
useCss
</name>
<tag-class>org.unidal.webres.taglib.basic.
UseCss
TagHandler</tag-class>
<description><![CDATA[
Image
Resource Tag]]></description>
<name>
img
</name>
<tag-class>org.unidal.webres.taglib.basic.
Image
TagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[
Set the css value with EL or a css ref
.]]></description>
<description><![CDATA[
The value for image, could be a expression or a image path
.]]></description>
<name>value</name>
<required>
fals
e</required>
<required>
tru
e</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Identify whether the
link
URL is secure or not.]]></description>
<description><![CDATA[Identify whether the
image
URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for
Css
.]]></description>
<description><![CDATA[The reference id for
img
.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
...
...
@@ -211,28 +232,14 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Target placement for this css resource to render]]></description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[
useJs
Resource Tag]]></description>
<name>
useJs
</name>
<tag-class>org.unidal.webres.taglib.basic.
UseJs
TagHandler</tag-class>
<description><![CDATA[
cssSlot
Resource Tag]]></description>
<name>
cssSlot
</name>
<tag-class>org.unidal.webres.taglib.basic.
CssSlot
TagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Set the js value with EL or a js ref.]]></description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
...
...
@@ -240,7 +247,7 @@
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for
Js
.]]></description>
<description><![CDATA[The reference id for
CssSlot
.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
...
...
@@ -253,13 +260,6 @@
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Target placement for this js resource to render]]></description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
</taglib>
cat-home/src/test/java/com/dianping/cat/demo/Demo.java
浏览文件 @
c671cf09
...
...
@@ -66,8 +66,7 @@ public class Demo extends ComponentTestCase {
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
t
.
setStatus
(
"child"
);
t
.
complete
();
...
...
cat-home/src/test/java/com/dianping/cat/demo/TestSendMessage.java
0 → 100644
浏览文件 @
c671cf09
package
com.dianping.cat.demo
;
import
org.junit.Test
;
import
com.dianping.cat.Cat
;
import
com.dianping.cat.message.Transaction
;
public
class
TestSendMessage
{
@Test
public
void
sendMessage
()
throws
Exception
{
for
(
int
i
=
0
;
i
<
100
;
i
++){
Transaction
t
=
Cat
.
getProducer
().
newTransaction
(
"Test"
,
"Test"
);
t
.
addData
(
"key and value"
);
t
.
complete
();
}
Thread
.
sleep
(
1000
);
}
}
cat-job/src/main/java/com/dianping/cat/job/spi/joblet/JobletRunner.java
浏览文件 @
c671cf09
...
...
@@ -147,11 +147,14 @@ public class JobletRunner extends ContainerHolder implements LogEnabled {
public
Progress
(
Logger
logger
,
String
token
,
float
[]
points
)
{
m_logger
=
logger
;
m_token
=
token
;
m_points
=
points
;
m_start
=
System
.
currentTimeMillis
();
m_last
=
m_start
;
m_lastPoint
=
0
;
if
(
points
==
null
){
m_points
=
new
float
[
0
];
}
else
{
m_points
=
Arrays
.
copyOf
(
points
,
points
.
length
);
}
m_logger
.
info
(
String
.
format
(
"%s%% %s ..."
,
0
,
m_token
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录