Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
山不在高_有仙则灵
SkyWalking
提交
bc4f1830
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,发现更多精彩内容 >>
提交
bc4f1830
编写于
11月 16, 2017
作者:
P
peng-yongsheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Trace dag ui with h2 storage provider test success.
上级
779638be
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
34 deletion
+24
-34
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeComponentH2UIDAO.java
...ng/apm/collector/storage/h2/dao/NodeComponentH2UIDAO.java
+7
-9
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeMappingH2UIDAO.java
...king/apm/collector/storage/h2/dao/NodeMappingH2UIDAO.java
+3
-6
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeReferenceH2UIDAO.java
...ng/apm/collector/storage/h2/dao/NodeReferenceH2UIDAO.java
+14
-19
未找到文件。
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeComponentH2UIDAO.java
浏览文件 @
bc4f1830
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
package
org.skywalking.apm.collector.storage.h2.dao
;
package
org.skywalking.apm.collector.storage.h2.dao
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonObject
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
org.skywalking.apm.collector.client.h2.H2Client
;
import
org.skywalking.apm.collector.client.h2.H2Client
;
...
@@ -27,7 +28,6 @@ import org.skywalking.apm.collector.storage.base.sql.SqlBuilder;
...
@@ -27,7 +28,6 @@ import org.skywalking.apm.collector.storage.base.sql.SqlBuilder;
import
org.skywalking.apm.collector.storage.dao.INodeComponentUIDAO
;
import
org.skywalking.apm.collector.storage.dao.INodeComponentUIDAO
;
import
org.skywalking.apm.collector.storage.h2.base.dao.H2DAO
;
import
org.skywalking.apm.collector.storage.h2.base.dao.H2DAO
;
import
org.skywalking.apm.collector.storage.table.node.NodeComponentTable
;
import
org.skywalking.apm.collector.storage.table.node.NodeComponentTable
;
import
org.skywalking.apm.network.trace.component.ComponentsDefine
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
...
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
public
class
NodeComponentH2UIDAO
extends
H2DAO
implements
INodeComponentUIDAO
{
public
class
NodeComponentH2UIDAO
extends
H2DAO
implements
INodeComponentUIDAO
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
NodeComponentH2UIDAO
.
class
);
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
NodeComponentH2UIDAO
.
class
);
private
static
final
String
AGGREGATE_COMPONENT_SQL
=
"select {0}, {1}
, {2} from {3} where {4} >= ? and {4} <= ? group by {0}, {1}, {2
} limit 100"
;
private
static
final
String
AGGREGATE_COMPONENT_SQL
=
"select {0}, {1}
from {2} where {3} >= ? and {3} <= ? group by {0}, {1
} limit 100"
;
public
NodeComponentH2UIDAO
(
H2Client
client
)
{
public
NodeComponentH2UIDAO
(
H2Client
client
)
{
super
(
client
);
super
(
client
);
...
@@ -53,19 +53,17 @@ public class NodeComponentH2UIDAO extends H2DAO implements INodeComponentUIDAO {
...
@@ -53,19 +53,17 @@ public class NodeComponentH2UIDAO extends H2DAO implements INodeComponentUIDAO {
H2Client
client
=
getClient
();
H2Client
client
=
getClient
();
JsonArray
nodeComponentArray
=
new
JsonArray
();
JsonArray
nodeComponentArray
=
new
JsonArray
();
String
sql
=
SqlBuilder
.
buildSql
(
AGGREGATE_COMPONENT_SQL
,
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
String
sql
=
SqlBuilder
.
buildSql
(
AGGREGATE_COMPONENT_SQL
,
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
NodeComponentTable
.
COLUMN_PEER_ID
,
NodeComponentTable
.
TABLE
,
NodeComponentTable
.
COLUMN_TIME_BUCKET
);
NodeComponentTable
.
TABLE
,
NodeComponentTable
.
COLUMN_TIME_BUCKET
);
Object
[]
params
=
new
Object
[]
{
startTime
,
endTime
};
Object
[]
params
=
new
Object
[]
{
startTime
,
endTime
};
try
(
ResultSet
rs
=
client
.
executeQuery
(
sql
,
params
))
{
try
(
ResultSet
rs
=
client
.
executeQuery
(
sql
,
params
))
{
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
int
peerId
=
rs
.
getInt
(
NodeComponentTable
.
COLUMN_PEER_ID
);
int
peerId
=
rs
.
getInt
(
NodeComponentTable
.
COLUMN_PEER_ID
);
int
componentId
=
rs
.
getInt
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
);
int
componentId
=
rs
.
getInt
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
);
String
componentName
=
ComponentsDefine
.
getInstance
().
getComponentName
(
componentId
);
JsonObject
nodeComponentObj
=
new
JsonObject
();
if
(
peerId
!=
0
)
{
nodeComponentObj
.
addProperty
(
NodeComponentTable
.
COLUMN_COMPONENT_ID
,
componentId
);
//TODO ApplicationCache
nodeComponentObj
.
addProperty
(
NodeComponentTable
.
COLUMN_PEER_ID
,
peerId
);
// String peer = ApplicationCache.get(peerId);
nodeComponentArray
.
add
(
nodeComponentObj
);
// nodeComponentArray.add(buildNodeComponent(peer, componentName));
}
}
}
}
catch
(
SQLException
|
H2ClientException
e
)
{
}
catch
(
SQLException
|
H2ClientException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeMappingH2UIDAO.java
浏览文件 @
bc4f1830
...
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
...
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
public
class
NodeMappingH2UIDAO
extends
H2DAO
implements
INodeMappingUIDAO
{
public
class
NodeMappingH2UIDAO
extends
H2DAO
implements
INodeMappingUIDAO
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
NodeMappingH2UIDAO
.
class
);
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
NodeMappingH2UIDAO
.
class
);
private
static
final
String
NODE_MAPPING_SQL
=
"select {0}, {1}
, {2} from {3} where {4} >= ? and {4} <= ? group by {0}, {1}, {2
} limit 100"
;
private
static
final
String
NODE_MAPPING_SQL
=
"select {0}, {1}
from {2} where {3} >= ? and {3} <= ? group by {0}, {1
} limit 100"
;
public
NodeMappingH2UIDAO
(
H2Client
client
)
{
public
NodeMappingH2UIDAO
(
H2Client
client
)
{
super
(
client
);
super
(
client
);
...
@@ -53,13 +53,10 @@ public class NodeMappingH2UIDAO extends H2DAO implements INodeMappingUIDAO {
...
@@ -53,13 +53,10 @@ public class NodeMappingH2UIDAO extends H2DAO implements INodeMappingUIDAO {
try
(
ResultSet
rs
=
client
.
executeQuery
(
sql
,
params
))
{
try
(
ResultSet
rs
=
client
.
executeQuery
(
sql
,
params
))
{
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
int
applicationId
=
rs
.
getInt
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
);
int
applicationId
=
rs
.
getInt
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
);
//TODO ApplicationCache
// String applicationCode = ApplicationCache.get(applicationId);
int
addressId
=
rs
.
getInt
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
);
int
addressId
=
rs
.
getInt
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
);
// String address = ApplicationCache.get(addressId);
JsonObject
nodeMappingObj
=
new
JsonObject
();
JsonObject
nodeMappingObj
=
new
JsonObject
();
// nodeMappingObj.addProperty("applicationCode", applicationCode
);
nodeMappingObj
.
addProperty
(
NodeMappingTable
.
COLUMN_APPLICATION_ID
,
applicationId
);
// nodeMappingObj.addProperty("address", address
);
nodeMappingObj
.
addProperty
(
NodeMappingTable
.
COLUMN_ADDRESS_ID
,
addressId
);
nodeMappingArray
.
add
(
nodeMappingObj
);
nodeMappingArray
.
add
(
nodeMappingObj
);
}
}
}
catch
(
SQLException
|
H2ClientException
e
)
{
}
catch
(
SQLException
|
H2ClientException
e
)
{
...
...
apm-collector/apm-collector-storage/collector-storage-h2-provider/src/main/java/org/skywalking/apm/collector/storage/h2/dao/NodeReferenceH2UIDAO.java
浏览文件 @
bc4f1830
...
@@ -24,6 +24,7 @@ import java.sql.ResultSet;
...
@@ -24,6 +24,7 @@ import java.sql.ResultSet;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
org.skywalking.apm.collector.client.h2.H2Client
;
import
org.skywalking.apm.collector.client.h2.H2Client
;
import
org.skywalking.apm.collector.client.h2.H2ClientException
;
import
org.skywalking.apm.collector.client.h2.H2ClientException
;
import
org.skywalking.apm.collector.core.util.ColumnNameUtils
;
import
org.skywalking.apm.collector.storage.base.sql.SqlBuilder
;
import
org.skywalking.apm.collector.storage.base.sql.SqlBuilder
;
import
org.skywalking.apm.collector.storage.dao.INodeReferenceUIDAO
;
import
org.skywalking.apm.collector.storage.dao.INodeReferenceUIDAO
;
import
org.skywalking.apm.collector.storage.h2.base.dao.H2DAO
;
import
org.skywalking.apm.collector.storage.h2.base.dao.H2DAO
;
...
@@ -37,8 +38,8 @@ import org.slf4j.LoggerFactory;
...
@@ -37,8 +38,8 @@ import org.slf4j.LoggerFactory;
public
class
NodeReferenceH2UIDAO
extends
H2DAO
implements
INodeReferenceUIDAO
{
public
class
NodeReferenceH2UIDAO
extends
H2DAO
implements
INodeReferenceUIDAO
{
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
NodeReferenceH2UIDAO
.
class
);
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
NodeReferenceH2UIDAO
.
class
);
private
static
final
String
NODE_REFERENCE_SQL
=
"select {8}, {9},
{10},
sum({0}) as {0}, sum({1}) as {1}, sum({2}) as {2}, "
+
private
static
final
String
NODE_REFERENCE_SQL
=
"select {8}, {9}, sum({0}) as {0}, sum({1}) as {1}, sum({2}) as {2}, "
+
"sum({3}) as {3}, sum({4}) as {4}, sum({5}) as {5} from {6} where {7} >= ? and {7} <= ? group by {8}, {9}
, {10}
limit 100"
;
"sum({3}) as {3}, sum({4}) as {4}, sum({5}) as {5} from {6} where {7} >= ? and {7} <= ? group by {8}, {9} limit 100"
;
public
NodeReferenceH2UIDAO
(
H2Client
client
)
{
public
NodeReferenceH2UIDAO
(
H2Client
client
)
{
super
(
client
);
super
(
client
);
...
@@ -56,24 +57,18 @@ public class NodeReferenceH2UIDAO extends H2DAO implements INodeReferenceUIDAO {
...
@@ -56,24 +57,18 @@ public class NodeReferenceH2UIDAO extends H2DAO implements INodeReferenceUIDAO {
Object
[]
params
=
new
Object
[]
{
startTime
,
endTime
};
Object
[]
params
=
new
Object
[]
{
startTime
,
endTime
};
try
(
ResultSet
rs
=
client
.
executeQuery
(
sql
,
params
))
{
try
(
ResultSet
rs
=
client
.
executeQuery
(
sql
,
params
))
{
while
(
rs
.
next
())
{
while
(
rs
.
next
())
{
int
applicationId
=
rs
.
getInt
(
NodeReferenceTable
.
COLUMN_FRONT_APPLICATION_ID
);
int
frontApplicationId
=
rs
.
getInt
(
NodeReferenceTable
.
COLUMN_FRONT_APPLICATION_ID
);
//TODO ApplicationCache
// String applicationCode = ApplicationCache.get(applicationId);
int
behindApplicationId
=
rs
.
getInt
(
NodeReferenceTable
.
COLUMN_BEHIND_APPLICATION_ID
);
int
behindApplicationId
=
rs
.
getInt
(
NodeReferenceTable
.
COLUMN_BEHIND_APPLICATION_ID
);
if
(
behindApplicationId
!=
0
)
{
JsonObject
nodeRefResSumObj
=
new
JsonObject
();
// String behindApplicationCode = ApplicationCache.get(behindApplicationId);
nodeRefResSumObj
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
NodeReferenceTable
.
COLUMN_FRONT_APPLICATION_ID
),
frontApplicationId
);
nodeRefResSumObj
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
NodeReferenceTable
.
COLUMN_BEHIND_APPLICATION_ID
),
behindApplicationId
);
JsonObject
nodeRefResSumObj
=
new
JsonObject
();
nodeRefResSumObj
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
NodeReferenceTable
.
COLUMN_S1_LTE
),
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_S1_LTE
));
// nodeRefResSumObj.addProperty("front", applicationCode);
nodeRefResSumObj
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
NodeReferenceTable
.
COLUMN_S3_LTE
),
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_S3_LTE
));
// nodeRefResSumObj.addProperty("behind", behindApplicationCode);
nodeRefResSumObj
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
NodeReferenceTable
.
COLUMN_S5_LTE
),
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_S5_LTE
));
nodeRefResSumObj
.
addProperty
(
NodeReferenceTable
.
COLUMN_S1_LTE
,
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_S1_LTE
));
nodeRefResSumObj
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
NodeReferenceTable
.
COLUMN_S5_GT
),
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_S5_GT
));
nodeRefResSumObj
.
addProperty
(
NodeReferenceTable
.
COLUMN_S3_LTE
,
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_S3_LTE
));
nodeRefResSumObj
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
NodeReferenceTable
.
COLUMN_ERROR
),
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_ERROR
));
nodeRefResSumObj
.
addProperty
(
NodeReferenceTable
.
COLUMN_S5_LTE
,
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_S5_LTE
));
nodeRefResSumObj
.
addProperty
(
ColumnNameUtils
.
INSTANCE
.
rename
(
NodeReferenceTable
.
COLUMN_SUMMARY
),
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_SUMMARY
));
nodeRefResSumObj
.
addProperty
(
NodeReferenceTable
.
COLUMN_S5_GT
,
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_S5_GT
));
nodeRefResSumArray
.
add
(
nodeRefResSumObj
);
nodeRefResSumObj
.
addProperty
(
NodeReferenceTable
.
COLUMN_ERROR
,
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_ERROR
));
nodeRefResSumObj
.
addProperty
(
NodeReferenceTable
.
COLUMN_SUMMARY
,
rs
.
getDouble
(
NodeReferenceTable
.
COLUMN_SUMMARY
));
nodeRefResSumArray
.
add
(
nodeRefResSumObj
);
}
}
}
}
catch
(
SQLException
|
H2ClientException
e
)
{
}
catch
(
SQLException
|
H2ClientException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
logger
.
error
(
e
.
getMessage
(),
e
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录