Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
f0d87c2f
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,发现更多精彩内容 >>
提交
f0d87c2f
编写于
9月 11, 2013
作者:
Y
yong.you
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the frequent function url build error
上级
f6a82d67
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
99 addition
and
95 deletion
+99
-95
cat-consumer-advanced/src/main/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java
...n/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java
+1
-1
cat-consumer-advanced/src/main/java/com/dianping/cat/consumer/dependency/DependencyAnalyzer.java
.../dianping/cat/consumer/dependency/DependencyAnalyzer.java
+1
-1
cat-consumer-advanced/src/main/java/com/dianping/cat/consumer/matrix/MatrixAnalyzer.java
...java/com/dianping/cat/consumer/matrix/MatrixAnalyzer.java
+1
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java
...ianping/cat/consumer/transaction/TransactionAnalyzer.java
+1
-1
cat-core/src/main/java/com/dianping/cat/ServerConfigManager.java
...e/src/main/java/com/dianping/cat/ServerConfigManager.java
+80
-80
cat-core/src/main/java/com/dianping/cat/storage/DefaultBucketManager.java
...n/java/com/dianping/cat/storage/DefaultBucketManager.java
+1
-5
cat-home/src/main/webapp/WEB-INF/tags/body.tag
cat-home/src/main/webapp/WEB-INF/tags/body.tag
+1
-6
cat-home/src/main/webapp/WEB-INF/tags/historyReport.tag
cat-home/src/main/webapp/WEB-INF/tags/historyReport.tag
+6
-0
cat-home/src/main/webapp/WEB-INF/tags/hourlyReport.tag
cat-home/src/main/webapp/WEB-INF/tags/hourlyReport.tag
+7
-0
未找到文件。
cat-consumer-advanced/src/main/java/com/dianping/cat/consumer/cross/CrossAnalyzer.java
浏览文件 @
f0d87c2f
...
...
@@ -60,7 +60,7 @@ public class CrossAnalyzer extends AbstractMessageAnalyzer<CrossReport> implemen
}
public
CrossInfo
parseCorssTransaction
(
Transaction
t
,
MessageTree
tree
)
{
if
(
m_serverConfigManager
.
shouldDiscard
(
t
))
{
if
(
m_serverConfigManager
.
discardTransaction
(
t
))
{
return
null
;
}
else
{
String
type
=
t
.
getType
();
...
...
cat-consumer-advanced/src/main/java/com/dianping/cat/consumer/dependency/DependencyAnalyzer.java
浏览文件 @
f0d87c2f
...
...
@@ -169,7 +169,7 @@ public class DependencyAnalyzer extends AbstractMessageAnalyzer<DependencyReport
}
private
void
processTransaction
(
DependencyReport
report
,
MessageTree
tree
,
Transaction
t
)
{
if
(
m_serverConfigManager
.
shouldDiscard
(
t
))
{
if
(
m_serverConfigManager
.
discardTransaction
(
t
))
{
return
;
}
else
{
processTransactionType
(
report
,
t
);
...
...
cat-consumer-advanced/src/main/java/com/dianping/cat/consumer/matrix/MatrixAnalyzer.java
浏览文件 @
f0d87c2f
...
...
@@ -65,7 +65,7 @@ public class MatrixAnalyzer extends AbstractMessageAnalyzer<MatrixReport> implem
if
(
message
instanceof
Transaction
)
{
String
messageType
=
message
.
getType
();
if
(
m_serverConfigManager
.
shouldDiscard
((
Transaction
)
message
))
{
if
(
m_serverConfigManager
.
discardTransaction
((
Transaction
)
message
))
{
return
;
}
if
(
messageType
.
equals
(
"URL"
)
||
messageType
.
equals
(
"Service"
)
||
messageType
.
equals
(
"PigeonService"
))
{
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/transaction/TransactionAnalyzer.java
浏览文件 @
f0d87c2f
...
...
@@ -142,7 +142,7 @@ public class TransactionAnalyzer extends AbstractMessageAnalyzer<TransactionRepo
}
protected
void
processTransaction
(
TransactionReport
report
,
MessageTree
tree
,
Transaction
t
)
{
if
(
m_serverConfigManager
.
shouldDiscard
(
t
))
{
if
(
m_serverConfigManager
.
discardTransaction
(
t
))
{
return
;
}
else
{
String
ip
=
tree
.
getIpAddress
();
...
...
cat-core/src/main/java/com/dianping/cat/ServerConfigManager.java
浏览文件 @
f0d87c2f
...
...
@@ -51,22 +51,6 @@ public class ServerConfigManager implements Initializable, LogEnabled {
return
2280
;
}
public
boolean
isHdfsOn
()
{
return
!
m_config
.
getStorage
().
isHdfsDisabled
();
}
public
boolean
isSerialWrite
()
{
return
false
;
}
public
boolean
isClientCall
(
String
type
){
return
"PigeonCall"
.
equals
(
type
)
||
"Call"
.
equals
(
type
);
}
public
boolean
isServerService
(
String
type
){
return
"PigeonService"
.
equals
(
type
)
||
"Service"
.
equals
(
type
);
}
public
String
getConsoleDefaultDomain
()
{
if
(
m_config
!=
null
)
{
return
m_config
.
getConsole
().
getDefaultDomain
();
...
...
@@ -75,19 +59,6 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
}
public
String
getConsoleRemoteServers
()
{
if
(
m_config
!=
null
)
{
ConsoleConfig
console
=
m_config
.
getConsole
();
String
remoteServers
=
console
.
getRemoteServers
();
if
(
remoteServers
!=
null
&&
remoteServers
.
length
()
>
0
)
{
return
remoteServers
;
}
}
return
""
;
}
public
List
<
Pair
<
String
,
Integer
>>
getConsoleEndpoints
()
{
if
(
m_config
!=
null
)
{
ConsoleConfig
console
=
m_config
.
getConsole
();
...
...
@@ -109,6 +80,27 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
}
public
String
getConsoleRemoteServers
()
{
if
(
m_config
!=
null
)
{
ConsoleConfig
console
=
m_config
.
getConsole
();
String
remoteServers
=
console
.
getRemoteServers
();
if
(
remoteServers
!=
null
&&
remoteServers
.
length
()
>
0
)
{
return
remoteServers
;
}
}
return
""
;
}
public
String
getEmailAccount
()
{
return
"book.robot.dianping@gmail.com"
;
}
public
String
getEmailPassword
()
{
return
"xudgtsnoxivwclna"
;
}
public
String
getHdfsBaseDir
(
String
id
)
{
if
(
m_config
!=
null
)
{
HdfsConfig
hdfsConfig
=
m_config
.
getStorage
().
findHdfs
(
id
);
...
...
@@ -178,6 +170,10 @@ public class ServerConfigManager implements Initializable, LogEnabled {
return
null
;
}
public
String
getHttpSmsApi
()
{
return
""
;
}
public
Map
<
String
,
Domain
>
getLongConfigDomains
()
{
if
(
m_config
!=
null
)
{
LongConfig
longConfig
=
m_config
.
getConsumer
().
getLongConfig
();
...
...
@@ -228,6 +224,15 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
}
@Override
public
void
initialize
()
throws
InitializationException
{
m_unusedTypes
.
add
(
"Service"
);
m_unusedTypes
.
add
(
"PigeonService"
);
m_unusedNames
.
add
(
"piegonService:heartTaskService:heartBeat"
);
m_unusedNames
.
add
(
"piegonService:heartTaskService:heartBeat()"
);
m_unusedNames
.
add
(
"pigeon:HeartBeatService:null"
);
}
public
void
initialize
(
File
configFile
)
throws
Exception
{
if
(
configFile
!=
null
&&
configFile
.
canRead
())
{
m_logger
.
info
(
String
.
format
(
"Loading configuration file(%s) ..."
,
configFile
.
getCanonicalPath
()));
...
...
@@ -256,54 +261,59 @@ public class ServerConfigManager implements Initializable, LogEnabled {
}
public
boolean
isClientCall
(
String
type
)
{
return
"PigeonCall"
.
equals
(
type
)
||
"Call"
.
equals
(
type
);
}
public
boolean
isHdfsOn
()
{
return
!
m_config
.
getStorage
().
isHdfsDisabled
();
}
public
boolean
isInitialized
()
{
return
m_config
!=
null
;
}
public
boolean
is
LocalMod
e
()
{
public
boolean
is
JobMachin
e
()
{
if
(
m_config
!=
null
)
{
return
m_config
.
is
LocalMod
e
();
return
m_config
.
is
JobMachin
e
();
}
else
{
return
true
;
}
}
public
boolean
is
JobMachin
e
()
{
public
boolean
is
LocalMod
e
()
{
if
(
m_config
!=
null
)
{
return
m_config
.
is
JobMachin
e
();
return
m_config
.
is
LocalMod
e
();
}
else
{
return
true
;
}
}
private
long
toLong
(
String
str
,
long
defaultValue
)
{
long
value
=
0
;
int
len
=
str
==
null
?
0
:
str
.
length
();
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
char
ch
=
str
.
charAt
(
i
);
if
(
Character
.
isDigit
(
ch
))
{
value
=
value
*
10L
+
(
ch
-
'0'
);
}
else
if
(
ch
==
'm'
||
ch
==
'M'
)
{
value
*=
1024
*
1024L
;
}
else
if
(
ch
==
'k'
||
ch
==
'K'
)
{
value
*=
1024L
;
public
boolean
isOfflineServer
(
String
ip
)
{
if
(
ip
!=
null
&&
ip
.
startsWith
(
"192."
))
{
return
true
;
}
else
{
return
false
;
}
}
if
(
value
>
0
)
{
return
value
;
public
boolean
isOnlineServer
(
String
ip
)
{
if
(
ip
!=
null
&&
ip
.
startsWith
(
"10."
))
{
return
true
;
}
else
{
return
defaultValu
e
;
return
fals
e
;
}
}
public
boolean
validateDomain
(
String
domain
)
{
return
!
domain
.
equals
(
"PhoenixAgent"
)
&&
!
domain
.
equals
(
Constants
.
FRONT_END
)
;
public
boolean
isSerialWrite
(
)
{
return
false
;
}
public
boolean
shouldDiscard
(
Transaction
t
)
{
public
boolean
isServerService
(
String
type
)
{
return
"PigeonService"
.
equals
(
type
)
||
"Service"
.
equals
(
type
);
}
public
boolean
discardTransaction
(
Transaction
t
)
{
// pigeon default heartbeat is no use
String
type
=
t
.
getType
();
String
name
=
t
.
getName
();
...
...
@@ -314,41 +324,31 @@ public class ServerConfigManager implements Initializable, LogEnabled {
return
false
;
}
public
boolean
isOnlineServer
(
String
ip
)
{
if
(
ip
!=
null
&&
ip
.
startsWith
(
"10."
))
{
return
true
;
}
else
{
return
false
;
}
}
private
long
toLong
(
String
str
,
long
defaultValue
)
{
long
value
=
0
;
int
len
=
str
==
null
?
0
:
str
.
length
();
public
boolean
isOfflineServer
(
String
ip
)
{
if
(
ip
!=
null
&&
ip
.
startsWith
(
"192."
))
{
return
true
;
}
else
{
return
false
;
}
}
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
char
ch
=
str
.
charAt
(
i
);
@Override
public
void
initialize
()
throws
InitializationException
{
m_unusedTypes
.
add
(
"Service"
);
m_unusedTypes
.
add
(
"PigeonService"
);
m_unusedNames
.
add
(
"piegonService:heartTaskService:heartBeat"
);
m_unusedNames
.
add
(
"piegonService:heartTaskService:heartBeat()"
);
m_unusedNames
.
add
(
"pigeon:HeartBeatService:null"
);
if
(
Character
.
isDigit
(
ch
))
{
value
=
value
*
10L
+
(
ch
-
'0'
);
}
else
if
(
ch
==
'm'
||
ch
==
'M'
)
{
value
*=
1024
*
1024L
;
}
else
if
(
ch
==
'k'
||
ch
==
'K'
)
{
value
*=
1024L
;
}
public
String
getEmailAccount
(){
return
"book.robot.dianping@gmail.com"
;
}
public
String
getEmailPassword
(){
return
"xudgtsnoxivwclna"
;
if
(
value
>
0
)
{
return
value
;
}
else
{
return
defaultValue
;
}
}
public
String
getHttpSmsApi
()
{
return
""
;
public
boolean
validateDomain
(
String
domain
)
{
return
!
domain
.
equals
(
"PhoenixAgent"
)
&&
!
domain
.
equals
(
Constants
.
FRONT_END
)
;
}
}
cat-core/src/main/java/com/dianping/cat/storage/DefaultBucketManager.java
浏览文件 @
f0d87c2f
...
...
@@ -58,10 +58,6 @@ public class DefaultBucketManager extends ContainerHolder implements BucketManag
String
path
;
Date
date
=
new
Date
(
timestamp
);
// if (type == MessageTree.class) {
// path = m_pathBuilder.getMessagePath(name, date);
// } else {
// }
path
=
m_pathBuilder
.
getReportPath
(
name
,
date
);
Entry
entry
=
new
Entry
(
type
,
path
,
namespace
);
...
...
@@ -86,7 +82,7 @@ public class DefaultBucketManager extends ContainerHolder implements BucketManag
return
getBucket
(
String
.
class
,
timestamp
,
name
,
"report"
);
}
static
class
Entry
{
public
static
class
Entry
{
private
String
m_namespace
;
private
String
m_path
;
...
...
cat-home/src/main/webapp/WEB-INF/tags/body.tag
浏览文件 @
f0d87c2f
...
...
@@ -58,7 +58,7 @@
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
id=
"myModalLabel"
class=
"text-success"
>
用户登录
</h4>
<h4
id=
"myModalLabel"
class=
"text-success
text-center
"
>
用户登录
</h4>
</div>
<div
class=
"control-group"
>
<label
class=
"control-label text-success"
for=
"account"
>
用户名
</label>
...
...
@@ -111,11 +111,6 @@
$
(
'
#frequent
'
).
html
(
"
常用
"
);
}
}
function
buildHref
(
domain
){
var
href
=
'
<a href="?op=history&domain=
'
+
domain
+
'
&date=${model.date}"> [
'
+
domain
+
'
] </a>
'
;
return
href
;
}
$
(
document
).
ready
(
function
()
{
var
domains
=
getcookie
(
'
CAT_DOMAINS
'
);
var
domainArray
=
domains
.
split
(
"
|
"
);
...
...
cat-home/src/main/webapp/WEB-INF/tags/historyReport.tag
浏览文件 @
f0d87c2f
...
...
@@ -9,6 +9,12 @@
<%@ attribute name="subtitle" fragment="true"%>
<a:body>
<script>
function buildHref(domain){
var href = '<a href="?op=history&domain='+domain+'&date=${model.date}"> [ '+domain+' ] </a>';
return href;
}
</script>
<div class="report">
<table class="header">
<tr>
...
...
cat-home/src/main/webapp/WEB-INF/tags/hourlyReport.tag
浏览文件 @
f0d87c2f
...
...
@@ -9,6 +9,13 @@
<%@ attribute name="subtitle" fragment="true"%>
<a:body>
<script>
function buildHref(domain){
var href = '<a href="?domain='+domain+'&date=${model.date}"> [ '+domain+' ] </a>';
return href;
}
</script>
<div class="report">
<table class="header">
<tr>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录