Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
5d5f4de4
S
SkyWalking
项目概览
山不在高_有仙则灵
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
12
Star
0
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
SkyWalking
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5d5f4de4
编写于
1月 24, 2016
作者:
wu-sheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.修改部分方法访问限制。
2.修改部分类名
上级
6d6c9c72
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
22 addition
and
27 deletion
+22
-27
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/AnalysisServerDriver.java
...om/ai/cloud/skywalking/analysis/AnalysisServerDriver.java
+0
-4
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/Categorize2ChainMapper.java
...ing/analysis/categorize2chain/Categorize2ChainMapper.java
+1
-1
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/Categorize2ChainReducer.java
...ng/analysis/categorize2chain/Categorize2ChainReducer.java
+1
-1
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/ChainSummary.java
...ud/skywalking/analysis/categorize2chain/ChainSummary.java
+2
-2
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/SpanEntry.java
...cloud/skywalking/analysis/categorize2chain/SpanEntry.java
+2
-3
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/SubLevelSpanCostCounter.java
...ng/analysis/categorize2chain/SubLevelSpanCostCounter.java
+1
-1
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/SpanNodeProcessFilter.java
...alysis/categorize2chain/filter/SpanNodeProcessFilter.java
+3
-3
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/AppendBusinessKeyFilter.java
...categorize2chain/filter/impl/AppendBusinessKeyFilter.java
+2
-2
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/CopyAttrFilter.java
...analysis/categorize2chain/filter/impl/CopyAttrFilter.java
+2
-2
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/ProcessCostTimeFilter.java
...s/categorize2chain/filter/impl/ProcessCostTimeFilter.java
+4
-4
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/ReplaceAddressFilter.java
...is/categorize2chain/filter/impl/ReplaceAddressFilter.java
+2
-2
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/TokenGenerateFilter.java
...sis/categorize2chain/filter/impl/TokenGenerateFilter.java
+2
-2
未找到文件。
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/AnalysisServerDriver.java
浏览文件 @
5d5f4de4
...
...
@@ -7,14 +7,10 @@ import java.util.Date;
import
org.apache.hadoop.conf.Configuration
;
import
org.apache.hadoop.conf.Configured
;
import
org.apache.hadoop.fs.Path
;
import
org.apache.hadoop.hbase.MetaTableAccessor
;
import
org.apache.hadoop.hbase.TableName
;
import
org.apache.hadoop.hbase.client.Scan
;
import
org.apache.hadoop.hbase.mapreduce.TableMapReduceUtil
;
import
org.apache.hadoop.io.Text
;
import
org.apache.hadoop.mapreduce.Job
;
import
org.apache.hadoop.mapreduce.lib.output.FileOutputFormat
;
import
org.apache.hadoop.mapreduce.lib.output.NullOutputFormat
;
import
org.apache.hadoop.util.GenericOptionsParser
;
import
org.apache.hadoop.util.Tool
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/Categorize2ChainMapper.java
浏览文件 @
5d5f4de4
...
...
@@ -43,7 +43,7 @@ public class Categorize2ChainMapper extends TableMapper<Text, ChainInfo> {
}
public
static
ChainInfo
spanToChainInfo
(
String
key
,
List
<
Span
>
spanList
)
{
CostMap
costMap
=
new
CostMap
();
SubLevelSpanCostCounter
costMap
=
new
SubLevelSpanCostCounter
();
ChainInfo
chainInfo
=
new
ChainInfo
();
Collections
.
sort
(
spanList
,
new
Comparator
<
Span
>()
{
@Override
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/Categorize2ChainReducer.java
浏览文件 @
5d5f4de4
...
...
@@ -27,7 +27,7 @@ public class Categorize2ChainReducer extends Reducer<Text, ChainInfo, Text, IntW
int
totalCount
=
0
;
try
{
ChainRelationship
chainRelate
=
HBaseUtil
.
selectCallChainRelationship
(
key
.
toString
());
Summary
summary
=
new
Summary
();
ChainSummary
summary
=
new
Chain
Summary
();
while
(
chainInfoIterator
.
hasNext
())
{
ChainInfo
chainInfo
=
chainInfoIterator
.
next
();
try
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/Summary.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/
Chain
Summary.java
浏览文件 @
5d5f4de4
...
...
@@ -12,12 +12,12 @@ import java.text.SimpleDateFormat;
import
java.util.*
;
import
java.util.Date
;
public
class
Summary
{
public
class
Chain
Summary
{
private
Map
<
String
,
ChainSpecificTimeWindowSummary
>
summaryResultMap
;
private
Map
<
String
,
Timestamp
>
updateChainInfo
;
public
Summary
()
{
public
Chain
Summary
()
{
summaryResultMap
=
new
HashMap
<
String
,
ChainSpecificTimeWindowSummary
>();
updateChainInfo
=
new
HashMap
<
String
,
Timestamp
>();
}
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/SpanEntry.java
浏览文件 @
5d5f4de4
...
...
@@ -8,7 +8,6 @@ public class SpanEntry {
private
Span
clientSpan
;
private
Span
serverSpan
;
private
String
startTime
;
public
SpanEntry
()
{
...
...
@@ -66,7 +65,7 @@ public class SpanEntry {
return
resultCost
;
}
p
ublic
long
getClientCost
()
{
p
rivate
long
getClientCost
()
{
if
(
clientSpan
!=
null
)
{
return
clientSpan
.
getCost
();
}
...
...
@@ -74,7 +73,7 @@ public class SpanEntry {
return
0
;
}
p
ublic
long
getServerCost
()
{
p
rivate
long
getServerCost
()
{
if
(
serverSpan
!=
null
)
{
return
serverSpan
.
getCost
();
}
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/
CostMap
.java
→
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/
SubLevelSpanCostCounter
.java
浏览文件 @
5d5f4de4
...
...
@@ -3,7 +3,7 @@ package com.ai.cloud.skywalking.analysis.categorize2chain;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
CostMap
{
public
class
SubLevelSpanCostCounter
{
private
Map
<
String
,
Long
>
costs
=
new
HashMap
<
String
,
Long
>();
public
void
put
(
String
parentLevel
,
Long
cost
)
{
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/SpanNodeProcessFilter.java
浏览文件 @
5d5f4de4
package
com.ai.cloud.skywalking.analysis.categorize2chain.filter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
CostMap
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
SubLevelSpanCostCounter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
...
...
@@ -8,9 +8,9 @@ public abstract class SpanNodeProcessFilter {
private
SpanNodeProcessFilter
nextProcessChain
;
public
abstract
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
CostMap
costMap
);
public
abstract
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
SubLevelSpanCostCounter
costMap
);
protected
void
doNext
(
SpanEntry
spanEntry
,
ChainNode
node
,
CostMap
costMap
){
protected
void
doNext
(
SpanEntry
spanEntry
,
ChainNode
node
,
SubLevelSpanCostCounter
costMap
){
if
(
nextProcessChain
!=
null
){
nextProcessChain
.
doFilter
(
spanEntry
,
node
,
costMap
);
}
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/AppendBusinessKeyFilter.java
浏览文件 @
5d5f4de4
package
com.ai.cloud.skywalking.analysis.categorize2chain.filter.impl
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
CostMap
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
SubLevelSpanCostCounter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
...
...
@@ -8,7 +8,7 @@ import com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode;
public
class
AppendBusinessKeyFilter
extends
SpanNodeProcessFilter
{
@Override
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
CostMap
costMap
)
{
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
SubLevelSpanCostCounter
costMap
)
{
node
.
setViewPoint
(
node
.
getViewPoint
()
+
spanEntry
.
getBusinessKey
());
this
.
doNext
(
spanEntry
,
node
,
costMap
);
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/CopyAttrFilter.java
浏览文件 @
5d5f4de4
package
com.ai.cloud.skywalking.analysis.categorize2chain.filter.impl
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
CostMap
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
SubLevelSpanCostCounter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
...
...
@@ -8,7 +8,7 @@ import com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode;
public
class
CopyAttrFilter
extends
SpanNodeProcessFilter
{
@Override
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
CostMap
costMap
)
{
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
SubLevelSpanCostCounter
costMap
)
{
node
.
setCallType
(
spanEntry
.
getCallType
().
toString
());
node
.
setStatus
(
spanEntry
.
getSpanStatus
());
node
.
setLevelId
(
spanEntry
.
getLevelId
());
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/ProcessCostTimeFilter.java
浏览文件 @
5d5f4de4
package
com.ai.cloud.skywalking.analysis.categorize2chain.filter.impl
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
CostMap
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
SubLevelSpanCostCounter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
public
class
ProcessCostTimeFilter
extends
SpanNodeProcessFilter
{
@Override
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
CostMap
costMap
)
{
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
SubLevelSpanCostCounter
costMap
)
{
node
.
setCost
(
spanEntry
.
getCost
());
this
.
saveCostAsSubNodeCost
(
spanEntry
,
node
,
costMap
);
...
...
@@ -17,7 +17,7 @@ public class ProcessCostTimeFilter extends SpanNodeProcessFilter {
}
private
void
saveCostAsSubNodeCost
(
SpanEntry
spanEntry
,
ChainNode
node
,
CostMap
costMap
)
{
SubLevelSpanCostCounter
costMap
)
{
long
subNodeCost
=
spanEntry
.
getCost
();
if
(
costMap
.
exists
(
spanEntry
.
getParentLevelId
()))
{
subNodeCost
+=
costMap
.
get
(
spanEntry
.
getParentLevelId
());
...
...
@@ -26,7 +26,7 @@ public class ProcessCostTimeFilter extends SpanNodeProcessFilter {
costMap
.
put
(
spanEntry
.
getParentLevelId
(),
subNodeCost
);
}
private
void
computeChainNodeCost
(
CostMap
costMap
,
ChainNode
node
)
{
private
void
computeChainNodeCost
(
SubLevelSpanCostCounter
costMap
,
ChainNode
node
)
{
String
levelId
=
node
.
getParentLevelId
();
if
(
levelId
!=
null
&&
levelId
.
length
()
>
0
)
{
levelId
+=
"."
;
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/ReplaceAddressFilter.java
浏览文件 @
5d5f4de4
package
com.ai.cloud.skywalking.analysis.categorize2chain.filter.impl
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
CostMap
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
SubLevelSpanCostCounter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
...
...
@@ -11,7 +11,7 @@ public class ReplaceAddressFilter extends SpanNodeProcessFilter {
private
static
String
IP_PORT_REGEX
=
"(([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))\\.([0-9]|[1-9][0-9]|1([0-9][0-9])|2([0-4][0-9]|5[0-5]))|localhost):([1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]|[0-9]{1,4})"
;
@Override
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
CostMap
costMap
)
{
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
SubLevelSpanCostCounter
costMap
)
{
String
viewPoint
=
spanEntry
.
getViewPoint
().
replaceAll
(
IP_PORT_REGEX
,
spanEntry
.
getApplicationId
());
node
.
setViewPoint
(
viewPoint
);
...
...
skywalking-analysis/src/main/java/com/ai/cloud/skywalking/analysis/categorize2chain/filter/impl/TokenGenerateFilter.java
浏览文件 @
5d5f4de4
package
com.ai.cloud.skywalking.analysis.categorize2chain.filter.impl
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
CostMap
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.
SubLevelSpanCostCounter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.SpanEntry
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.filter.SpanNodeProcessFilter
;
import
com.ai.cloud.skywalking.analysis.categorize2chain.model.ChainNode
;
...
...
@@ -9,7 +9,7 @@ import com.ai.cloud.skywalking.analysis.util.TokenGenerator;
public
class
TokenGenerateFilter
extends
SpanNodeProcessFilter
{
@Override
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
CostMap
costMap
)
{
public
void
doFilter
(
SpanEntry
spanEntry
,
ChainNode
node
,
SubLevelSpanCostCounter
costMap
)
{
String
nodeToken
=
TokenGenerator
.
generateNodeToken
(
node
.
getParentLevelId
()
+
"."
+
node
.
getLevelId
()
+
"-"
+
node
.
getViewPoint
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录