瀏覽代碼

添加耗时日志

wangwei 5 年之前
父節點
當前提交
00fef55355
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/SimpleNode.java

+ 6 - 0
src/main/java/cn/com/qmth/examcloud/commons/helpers/pipeline/SimpleNode.java

@@ -119,6 +119,7 @@ public class SimpleNode<KEYIN, VALUEIN, KEYOUT, VALUEOUT>
 	}
 
 	private void execute(KEYIN key, VALUEIN value) {
+		long s = System.currentTimeMillis();
 		try {
 			if (LOG.isDebugEnabled()) {
 				LOG.debug(new StringBuilder("[" + nodeName + "]. ").append("handle entry. key=")
@@ -158,6 +159,11 @@ public class SimpleNode<KEYIN, VALUEIN, KEYOUT, VALUEOUT>
 						.append(null == key ? null : key.toString()).append("; value=")
 						.append(null == value ? null : value.toString()).toString(), e);
 			}
+		} finally {
+			if (LOG.isDebugEnabled()) {
+				LOG.debug(new StringBuilder("[" + nodeName + "]. ").append("cost ")
+						.append(System.currentTimeMillis() - s).append("ms.").toString());
+			}
 		}
 	}