Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
48b33626
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,发现更多精彩内容 >>
提交
48b33626
编写于
7月 19, 2012
作者:
Y
You Yong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify the remeteId
上级
66be725b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
12 deletion
+16
-12
cat-consumer/src/main/java/com/dianping/cat/consumer/remote/RemoteIdChannelManager.java
.../dianping/cat/consumer/remote/RemoteIdChannelManager.java
+1
-1
cat-consumer/src/main/java/com/dianping/cat/consumer/remote/RemoteIdUploader.java
...va/com/dianping/cat/consumer/remote/RemoteIdUploader.java
+3
-3
cat-core/src/main/java/com/dianping/cat/configuration/ServerConfigManager.java
...a/com/dianping/cat/configuration/ServerConfigManager.java
+1
-2
cat-home/src/main/java/com/dianping/cat/report/page/matrix/DisplayMatrix.java
...va/com/dianping/cat/report/page/matrix/DisplayMatrix.java
+11
-5
cat-home/src/main/java/com/dianping/cat/report/page/model/spi/internal/BaseHistoricalModelService.java
...t/page/model/spi/internal/BaseHistoricalModelService.java
+0
-1
未找到文件。
cat-consumer/src/main/java/com/dianping/cat/consumer/remote/RemoteIdChannelManager.java
浏览文件 @
48b33626
...
...
@@ -84,7 +84,7 @@ public class RemoteIdChannelManager extends ContainerHolder implements Initializ
public
void
initialize
()
throws
InitializationException
{
ServerConfigManager
configManager
=
lookup
(
ServerConfigManager
.
class
);
m_baseDir
=
configManager
.
getHdfsLocalBaseDir
(
"
dump
"
);
m_baseDir
=
configManager
.
getHdfsLocalBaseDir
(
"
remote
"
);
}
private
RemoteIdChannel
makeChannel
(
String
key
,
String
path
,
long
startTime
)
throws
IOException
{
...
...
cat-consumer/src/main/java/com/dianping/cat/consumer/remote/RemoteIdUploader.java
浏览文件 @
48b33626
...
...
@@ -65,7 +65,7 @@ public class RemoteIdUploader implements Initializable, LogEnabled {
m_localMode
=
m_configManager
.
isLocalMode
();
if
(!
m_localMode
)
{
m_baseDir
=
m_configManager
.
getHdfsLocalBaseDir
(
"
dump
"
);
m_baseDir
=
m_configManager
.
getHdfsLocalBaseDir
(
"
remote
"
);
}
}
...
...
@@ -125,7 +125,7 @@ public class RemoteIdUploader implements Initializable, LogEnabled {
private
FSDataOutputStream
makeHdfsOutputStream
(
String
path
)
throws
IOException
{
StringBuilder
baseDir
=
new
StringBuilder
(
32
);
FileSystem
fs
=
m_fileSystemManager
.
getFileSystem
(
"
dump
"
,
baseDir
);
FileSystem
fs
=
m_fileSystemManager
.
getFileSystem
(
"
remote
"
,
baseDir
);
Path
file
=
new
Path
(
baseDir
.
toString
(),
path
);
FSDataOutputStream
out
=
fs
.
create
(
file
);
return
out
;
...
...
@@ -147,7 +147,7 @@ public class RemoteIdUploader implements Initializable, LogEnabled {
root
.
addData
(
"file"
,
file
);
root
.
setStatus
(
Message
.
SUCCESS
);
Transaction
t
=
cat
.
newTransaction
(
"Task"
,
"Upload
Dump
"
);
Transaction
t
=
cat
.
newTransaction
(
"Task"
,
"Upload
RemoteIds
"
);
t
.
addData
(
"file"
,
path
);
...
...
cat-core/src/main/java/com/dianping/cat/configuration/ServerConfigManager.java
浏览文件 @
48b33626
...
...
@@ -202,14 +202,13 @@ public class ServerConfigManager implements Initializable, LogEnabled {
m_logger
.
warn
(
"CAT server is running in LOCAL mode! No HDFS or MySQL will be accessed!"
);
}
Threads
.
forGroup
(
"Cat"
).
start
(
new
ServerConfigReloader
(
configFile
));
//
Threads.forGroup("Cat").start(new ServerConfigReloader(configFile));
}
public
boolean
isLocalMode
()
{
if
(
m_config
!=
null
)
{
return
m_config
.
isLocalMode
();
}
else
{
System
.
out
.
println
(
"Config is Null!!!->>>>>>>>>>>>>>>>>>>>>>>>>>>>"
);
return
true
;
}
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/matrix/DisplayMatrix.java
浏览文件 @
48b33626
...
...
@@ -98,7 +98,7 @@ public class DisplayMatrix {
return
(
int
)
(
o2
.
getSqlAvg
()
*
100
-
o1
.
getSqlAvg
()
*
100
);
}
if
(
m_sort
.
equalsIgnoreCase
(
"SqlAvgTotalTime"
))
{
return
o2
.
getSqlTime
()
-
o1
.
get
CacheMin
();
return
o2
.
getSqlTime
()
-
o1
.
get
SqlTime
();
}
if
(
m_sort
.
equalsIgnoreCase
(
"SqlTimePercent"
))
{
return
(
int
)
(
o2
.
getSqlTimePercent
()
*
100
-
o1
.
getSqlTimePercent
()
*
100
);
...
...
@@ -113,7 +113,7 @@ public class DisplayMatrix {
return
(
int
)
(
o2
.
getCacheAvg
()
*
100
-
o1
.
getCacheAvg
()
*
100
);
}
if
(
m_sort
.
equalsIgnoreCase
(
"CacheAvgTotalTime"
))
{
return
o2
.
getCacheTime
()
-
o1
.
getCache
Min
();
return
o2
.
getCacheTime
()
-
o1
.
getCache
Time
();
}
if
(
m_sort
.
equalsIgnoreCase
(
"CacheTimePercent"
))
{
return
(
int
)
(
o2
.
getCacheTimePercent
()
*
100
-
o1
.
getCacheTimePercent
()
*
100
);
...
...
@@ -181,7 +181,9 @@ public class DisplayMatrix {
if
(
matrix
.
getCount
()
>
0
)
{
m_cacheAvg
=
(
double
)
ratio
.
getTotalCount
()
/
(
double
)
matrix
.
getCount
();
}
m_cacheTime
=
(
int
)
(
ratio
.
getTotalTime
()
/
1000
);
if
(
m_cacheAvg
>
0
)
{
m_cacheTime
=
(
int
)
((
double
)
ratio
.
getTotalTime
()
/
1000
/
m_cacheAvg
/
m_count
);
}
if
(
matrix
.
getTotalTime
()
>
0
)
{
m_cacheTimePercent
=
(
double
)
ratio
.
getTotalTime
()
/
(
double
)
(
matrix
.
getTotalTime
());
}
...
...
@@ -194,7 +196,9 @@ public class DisplayMatrix {
if
(
matrix
.
getCount
()
>
0
)
{
m_sqlAvg
=
(
double
)
ratio
.
getTotalCount
()
/
(
double
)
matrix
.
getCount
();
}
m_sqlTime
=
(
int
)
(
ratio
.
getTotalTime
()
/
1000
);
if
(
m_sqlAvg
>
0
)
{
m_sqlTime
=
(
int
)
((
double
)
ratio
.
getTotalTime
()
/
1000
/
m_sqlAvg
/
m_count
);
}
if
(
matrix
.
getTotalTime
()
>
0
)
{
m_sqlTimePercent
=
(
double
)
ratio
.
getTotalTime
()
/
(
double
)
(
matrix
.
getTotalTime
());
}
...
...
@@ -207,7 +211,9 @@ public class DisplayMatrix {
if
(
matrix
.
getCount
()
>
0
)
{
m_callAvg
=
(
double
)
ratio
.
getTotalCount
()
/
(
double
)
matrix
.
getCount
();
}
m_callTime
=
(
int
)
(
ratio
.
getTotalTime
()
/
1000
);
if
(
m_callAvg
>
0
)
{
m_callTime
=
(
int
)
((
double
)
ratio
.
getTotalTime
()
/
1000
/
m_callAvg
/
m_count
);
}
if
(
matrix
.
getTotalTime
()
>
0
)
{
m_callTimePercent
=
(
double
)
ratio
.
getTotalTime
()
/
(
double
)
(
matrix
.
getTotalTime
());
}
...
...
cat-home/src/main/java/com/dianping/cat/report/page/model/spi/internal/BaseHistoricalModelService.java
浏览文件 @
48b33626
...
...
@@ -31,7 +31,6 @@ public abstract class BaseHistoricalModelService<T> extends ModelServiceWithCalS
ServerConfigManager
manager
=
lookup
(
ServerConfigManager
.
class
);
m_localMode
=
manager
.
isLocalMode
();
System
.
out
.
println
(
this
.
getClass
().
getName
()
+
">>>>>>>>>>>>>>>>Local Mode :"
+
m_localMode
);
}
@Override
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录