提交 c671cf09 编写于 作者: Y You Yong

modify the log and arrays coopy

上级 0b21d7c0
......@@ -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
......
......@@ -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 % 1000 == 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 % 1000 == 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);
......
......@@ -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());
}
......
......@@ -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 % 1000 == 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 % 1000 == 0) {
m_logger.error("Message queue is full in tcp socket sender! Count: " + count);
}
}
......
......@@ -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;
......
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;
}
......
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
......
......@@ -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() {
......
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) {
......
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) {
......
......@@ -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() {
......
<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>
......@@ -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 CssSlot.]]></description>
<description><![CDATA[The reference id for JsSlot.]]></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.ImageTagHandler</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.BeanTagHandler</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.JsSlotTagHandler</tag-class>
<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[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for JsSlot.]]></description>
<name>id</name>
<required>false</required>
<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>
</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>true</dynamic-attributes>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Link Resource Tag]]></description>
<name>link</name>
<tag-class>org.unidal.webres.taglib.basic.LinkTagHandler</tag-class>
<description><![CDATA[useJs Resource Tag]]></description>
<name>useJs</name>
<tag-class>org.unidal.webres.taglib.basic.UseJsTagHandler</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>true</required>
<required>false</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.SetTagHandler</tag-class>
<description><![CDATA[Link Resource Tag]]></description>
<name>link</name>
<tag-class>org.unidal.webres.taglib.basic.LinkTagHandler</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>true</required>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</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.UseCssTagHandler</tag-class>
<description><![CDATA[Image Resource Tag]]></description>
<name>img</name>
<tag-class>org.unidal.webres.taglib.basic.ImageTagHandler</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>false</required>
<required>true</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.UseJsTagHandler</tag-class>
<description><![CDATA[cssSlot Resource Tag]]></description>
<name>cssSlot</name>
<tag-class>org.unidal.webres.taglib.basic.CssSlotTagHandler</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>
......@@ -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();
......
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);
}
}
......@@ -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.
先完成此消息的编辑!
想要评论请 注册