Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
六月暴雪飞梨花
SkyWalking
提交
3f176bf5
S
SkyWalking
项目概览
六月暴雪飞梨花
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
未验证
提交
3f176bf5
编写于
6月 02, 2020
作者:
D
Daming
提交者:
GitHub
6月 02, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[hotfix]Fix UITemplate storage Influxdb implamented (#4849)
上级
d094a0f7
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
45 addition
and
60 deletion
+45
-60
oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/UITemplateManagementDAOImpl.java
...ge/plugin/influxdb/query/UITemplateManagementDAOImpl.java
+7
-16
test/e2e/e2e-test/docker/ttl/docker-compose.influxdb.yml
test/e2e/e2e-test/docker/ttl/docker-compose.influxdb.yml
+2
-5
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/storage/StorageE2E.java
...st/java/org/apache/skywalking/e2e/storage/StorageE2E.java
+33
-36
test/e2e/e2e-test/src/test/resources/expected/storage/dashboardConfiguration-change.yml
...ources/expected/storage/dashboardConfiguration-change.yml
+1
-1
test/e2e/e2e-test/src/test/resources/expected/storage/dashboardConfiguration-disable.yml
...urces/expected/storage/dashboardConfiguration-disable.yml
+1
-1
test/e2e/e2e-test/src/test/resources/expected/storage/dashboardConfiguration.yml
...est/resources/expected/storage/dashboardConfiguration.yml
+1
-1
未找到文件。
oap-server/server-storage-plugin/storage-influxdb-plugin/src/main/java/org/apache/skywalking/oap/server/storage/plugin/influxdb/query/UITemplateManagementDAOImpl.java
浏览文件 @
3f176bf5
...
...
@@ -85,7 +85,7 @@ public class UITemplateManagementDAOImpl implements UITemplateManagementDAO {
Point
point
=
Point
.
measurement
(
UITemplate
.
INDEX_NAME
)
.
tag
(
InfluxConstants
.
TagName
.
ID_COLUMN
,
uiTemplate
.
id
())
.
fields
(
builder
.
data2Map
(
uiTemplate
))
.
time
(
0L
,
TimeUnit
.
MILLI
SECONDS
)
.
time
(
1L
,
TimeUnit
.
NANO
SECONDS
)
.
build
();
client
.
write
(
point
);
return
TemplateChangeStatus
.
builder
().
status
(
true
).
build
();
...
...
@@ -104,8 +104,8 @@ public class UITemplateManagementDAOImpl implements UITemplateManagementDAO {
if
(
Objects
.
nonNull
(
series
))
{
Point
point
=
Point
.
measurement
(
UITemplate
.
INDEX_NAME
)
.
fields
(
builder
.
data2Map
(
uiTemplate
))
.
tag
(
series
.
getTags
())
.
time
(
0L
,
TimeUnit
.
MILLI
SECONDS
)
.
tag
(
InfluxConstants
.
TagName
.
ID_COLUMN
,
uiTemplate
.
id
())
.
time
(
1L
,
TimeUnit
.
NANO
SECONDS
)
.
build
();
client
.
write
(
point
);
return
TemplateChangeStatus
.
builder
().
status
(
true
).
build
();
...
...
@@ -118,22 +118,13 @@ public class UITemplateManagementDAOImpl implements UITemplateManagementDAO {
public
TemplateChangeStatus
disableTemplate
(
final
String
name
)
throws
IOException
{
WhereQueryImpl
<
SelectQueryImpl
>
query
=
select
().
all
()
.
from
(
client
.
getDatabase
(),
UITemplate
.
INDEX_NAME
)
.
where
(
eq
(
InfluxConstants
.
NAME
,
name
));
.
where
(
eq
(
InfluxConstants
.
TagName
.
ID_COLUMN
,
name
));
QueryResult
.
Series
series
=
client
.
queryForSingleSeries
(
query
);
if
(
Objects
.
nonNull
(
series
))
{
List
<
String
>
columnNames
=
series
.
getColumns
();
List
<
Object
>
columnValues
=
series
.
getValues
().
get
(
0
);
Map
<
String
,
Object
>
storageData
=
Maps
.
newHashMap
();
for
(
int
i
=
1
;
i
<
columnNames
.
size
();
i
++)
{
storageData
.
put
(
columnNames
.
get
(
i
),
columnValues
.
get
(
i
));
}
storageData
.
put
(
UITemplate
.
DISABLED
,
BooleanUtils
.
TRUE
);
Point
point
=
Point
.
measurement
(
UITemplate
.
INDEX_NAME
)
.
tag
(
series
.
getTags
()
)
.
fields
(
storageData
)
.
time
(
0L
,
TimeUnit
.
MILLI
SECONDS
)
.
tag
(
InfluxConstants
.
TagName
.
ID_COLUMN
,
name
)
.
addField
(
UITemplate
.
DISABLED
,
BooleanUtils
.
TRUE
)
.
time
(
1L
,
TimeUnit
.
NANO
SECONDS
)
.
build
();
client
.
write
(
point
);
return
TemplateChangeStatus
.
builder
().
status
(
true
).
build
();
...
...
test/e2e/e2e-test/docker/ttl/docker-compose.influxdb.yml
浏览文件 @
3f176bf5
...
...
@@ -34,12 +34,9 @@ services:
service
:
oap
environment
:
SW_STORAGE
:
influxdb
SW_STORAGE_ES_BULK_ACTIONS
:
1
SW_CORE_DATA_KEEPER_EXECUTE_PERIOD
:
1
SW_CORE_RECORD_DATA_TTL
:
7
SW_CORE_MINUTE_METRIC_DATA_TTL
:
6000
SW_CORE_HOUR_METRIC_DATA_TTL
:
100
SW_CORE_DAY_METRIC_DATA_TTL
:
5
SW_CORE_MONTH_METRIC_DATA_TTL
:
4
SW_STORAGE_ES_FLUSH_INTERVAL
:
1
depends_on
:
influxdb
:
condition
:
service_healthy
...
...
test/e2e/e2e-test/src/test/java/org/apache/skywalking/e2e/storage/StorageE2E.java
浏览文件 @
3f176bf5
...
...
@@ -20,6 +20,7 @@ package org.apache.skywalking.e2e.storage;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.skywalking.e2e.UIConfigurationManagementClient
;
import
org.apache.skywalking.e2e.annotation.ContainerHostAndPort
;
...
...
@@ -170,55 +171,51 @@ public class StorageE2E extends SkyWalkingTestAdapter {
@Test
void
addUITemplate
()
throws
Exception
{
try
{
TemplateChangeStatus
templateChangeStatus
=
graphql
.
addTemplate
(
assertTrue
(
graphql
.
addTemplate
(
emptySetting
(
"test-ui-config-1"
).
type
(
TemplateType
.
DASHBOARD
)
);
LOGGER
.
info
(
"add template = {}"
,
templateChangeStatus
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"add ui template error."
,
e
);
}
).
isStatus
()
);
TimeUnit
.
SECONDS
.
sleep
(
2L
);
verifyTemplates
(
"expected/storage/dashboardConfiguration.yml"
);
}
@Test
void
changeTemplate
()
throws
Exception
{
try
{
final
String
name
=
"test-ui-config-2"
;
assertTru
e
(
graphql
.
addTemplate
(
emptySetting
(
name
).
type
(
TemplateType
.
TOPOLOGY_SERVICE
)
).
isStatus
()
);
final
String
name
=
"test-ui-config-2"
;
assertTrue
(
graphql
.
addTemplat
e
(
emptySetting
(
name
).
type
(
TemplateType
.
DASHBOARD
)
).
isStatus
(
)
);
TimeUnit
.
SECONDS
.
sleep
(
2L
);
TemplateChangeStatus
templateChangeStatus
=
graphql
.
changeTemplate
(
emptySetting
(
name
).
configuration
(
"{\"key\":\"value\"}"
)
);
LOGGER
.
info
(
"change UITemplate = {}"
,
templateChangeStatus
);
assertTrue
(
templateChangeStatus
.
isStatus
());
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"add ui template error."
,
e
);
}
TemplateChangeStatus
templateChangeStatus
=
graphql
.
changeTemplate
(
emptySetting
(
name
).
type
(
TemplateType
.
TOPOLOGY_SERVICE
)
);
LOGGER
.
info
(
"change UITemplate = {}"
,
templateChangeStatus
);
assertTrue
(
templateChangeStatus
.
isStatus
());
TimeUnit
.
SECONDS
.
sleep
(
2L
);
verifyTemplates
(
"expected/storage/dashboardConfiguration-change.yml"
);
}
@Test
void
disableTemplate
()
throws
IO
Exception
{
try
{
final
String
name
=
"test-ui-config-3"
;
assertTru
e
(
graphql
.
addTemplate
(
emptySetting
(
name
).
type
(
TemplateType
.
DASHBOARD
)
).
isStatus
()
);
void
disableTemplate
()
throws
Exception
{
final
String
name
=
"test-ui-config-3"
;
assertTrue
(
graphql
.
addTemplat
e
(
emptySetting
(
name
).
type
(
TemplateType
.
DASHBOARD
)
).
isStatus
(
)
);
TimeUnit
.
SECONDS
.
sleep
(
2L
);
TemplateChangeStatus
templateChangeStatus
=
graphql
.
disableTemplate
(
name
);
LOGGER
.
info
(
"disable template = {}"
,
templateChangeStatus
);
assertTrue
(
templateChangeStatus
.
isStatus
());
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"add ui template error."
,
e
);
}
TemplateChangeStatus
templateChangeStatus
=
graphql
.
disableTemplate
(
name
);
LOGGER
.
info
(
"disable template = {}"
,
templateChangeStatus
);
assertTrue
(
templateChangeStatus
.
isStatus
());
TimeUnit
.
SECONDS
.
sleep
(
2L
);
verifyTemplates
(
"expected/storage/dashboardConfiguration-disable.yml"
);
}
...
...
test/e2e/e2e-test/src/test/resources/expected/storage/dashboardConfiguration-change.yml
浏览文件 @
3f176bf5
...
...
@@ -16,6 +16,6 @@
configurations
:
-
name
:
test-ui-config-2
type
:
TOPOLOGY_SERVICE
configuration
:
"
{}"
configuration
:
not
null
activated
:
true
disabled
:
false
test/e2e/e2e-test/src/test/resources/expected/storage/dashboardConfiguration-disable.yml
浏览文件 @
3f176bf5
...
...
@@ -15,7 +15,7 @@
configurations
:
-
name
:
test-ui-config-3
type
:
not
null
type
:
DASHBOARD
configuration
:
not
null
activated
:
true
disabled
:
true
test/e2e/e2e-test/src/test/resources/expected/storage/dashboardConfiguration.yml
浏览文件 @
3f176bf5
...
...
@@ -15,7 +15,7 @@
configurations
:
-
name
:
test-ui-config-1
type
:
not
null
type
:
DASHBOARD
configuration
:
not
null
activated
:
true
disabled
:
false
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录