Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
润土的好友猹
SkyWalking
提交
5d064ced
S
SkyWalking
项目概览
润土的好友猹
/
SkyWalking
与 Fork 源项目一致
Fork自
apache / SkyWalking
通知
9
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,发现更多精彩内容 >>
提交
5d064ced
编写于
11月 19, 2019
作者:
J
Jared Tan
提交者:
wu-sheng
11月 19, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make topN worker report period configurable. (#3892)
上级
a2dce716
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
12 addition
and
4 deletion
+12
-4
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java
...g/apache/skywalking/oap/server/core/CoreModuleConfig.java
+1
-0
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
...apache/skywalking/oap/server/core/CoreModuleProvider.java
+2
-0
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/TopNStreamProcessor.java
.../oap/server/core/analysis/worker/TopNStreamProcessor.java
+4
-1
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/TopNWorker.java
...kywalking/oap/server/core/analysis/worker/TopNWorker.java
+3
-3
oap-server/server-starter/src/main/assembly/application.yml
oap-server/server-starter/src/main/assembly/application.yml
+1
-0
oap-server/server-starter/src/main/resources/application.yml
oap-server/server-starter/src/main/resources/application.yml
+1
-0
未找到文件。
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleConfig.java
浏览文件 @
5d064ced
...
@@ -38,6 +38,7 @@ public class CoreModuleConfig extends ModuleConfig {
...
@@ -38,6 +38,7 @@ public class CoreModuleConfig extends ModuleConfig {
@Setter
private
int
maxConcurrentCallsPerConnection
;
@Setter
private
int
maxConcurrentCallsPerConnection
;
@Setter
private
int
maxMessageSize
;
@Setter
private
int
maxMessageSize
;
@Setter
private
boolean
enableDatabaseSession
;
@Setter
private
boolean
enableDatabaseSession
;
@Setter
private
int
topNReportPeriod
;
private
final
List
<
String
>
downsampling
;
private
final
List
<
String
>
downsampling
;
/**
/**
* The period of doing data persistence.
* The period of doing data persistence.
...
...
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
浏览文件 @
5d064ced
...
@@ -22,6 +22,7 @@ import java.io.IOException;
...
@@ -22,6 +22,7 @@ import java.io.IOException;
import
org.apache.skywalking.oap.server.configuration.api.ConfigurationModule
;
import
org.apache.skywalking.oap.server.configuration.api.ConfigurationModule
;
import
org.apache.skywalking.oap.server.core.analysis.*
;
import
org.apache.skywalking.oap.server.core.analysis.*
;
import
org.apache.skywalking.oap.server.core.analysis.worker.MetricsStreamProcessor
;
import
org.apache.skywalking.oap.server.core.analysis.worker.MetricsStreamProcessor
;
import
org.apache.skywalking.oap.server.core.analysis.worker.TopNStreamProcessor
;
import
org.apache.skywalking.oap.server.core.annotation.AnnotationScan
;
import
org.apache.skywalking.oap.server.core.annotation.AnnotationScan
;
import
org.apache.skywalking.oap.server.core.cache.*
;
import
org.apache.skywalking.oap.server.core.cache.*
;
import
org.apache.skywalking.oap.server.core.cluster.*
;
import
org.apache.skywalking.oap.server.core.cluster.*
;
...
@@ -170,6 +171,7 @@ public class CoreModuleProvider extends ModuleProvider {
...
@@ -170,6 +171,7 @@ public class CoreModuleProvider extends ModuleProvider {
this
.
registerServiceImplementation
(
RemoteClientManager
.
class
,
remoteClientManager
);
this
.
registerServiceImplementation
(
RemoteClientManager
.
class
,
remoteClientManager
);
MetricsStreamProcessor
.
getInstance
().
setEnableDatabaseSession
(
moduleConfig
.
isEnableDatabaseSession
());
MetricsStreamProcessor
.
getInstance
().
setEnableDatabaseSession
(
moduleConfig
.
isEnableDatabaseSession
());
TopNStreamProcessor
.
getInstance
().
setTopNWorkerReportCycle
(
moduleConfig
.
getTopNReportPeriod
());
}
}
@Override
public
void
start
()
throws
ModuleStartException
{
@Override
public
void
start
()
throws
ModuleStartException
{
...
...
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/TopNStreamProcessor.java
浏览文件 @
5d064ced
...
@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.analysis.worker;
...
@@ -20,6 +20,7 @@ package org.apache.skywalking.oap.server.core.analysis.worker;
import
java.util.*
;
import
java.util.*
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.apache.skywalking.oap.server.core.*
;
import
org.apache.skywalking.oap.server.core.*
;
import
org.apache.skywalking.oap.server.core.analysis.*
;
import
org.apache.skywalking.oap.server.core.analysis.*
;
import
org.apache.skywalking.oap.server.core.analysis.record.Record
;
import
org.apache.skywalking.oap.server.core.analysis.record.Record
;
...
@@ -41,6 +42,8 @@ public class TopNStreamProcessor implements StreamProcessor<TopN> {
...
@@ -41,6 +42,8 @@ public class TopNStreamProcessor implements StreamProcessor<TopN> {
@Getter
private
List
<
TopNWorker
>
persistentWorkers
=
new
ArrayList
<>();
@Getter
private
List
<
TopNWorker
>
persistentWorkers
=
new
ArrayList
<>();
private
Map
<
Class
<?
extends
Record
>,
TopNWorker
>
workers
=
new
HashMap
<>();
private
Map
<
Class
<?
extends
Record
>,
TopNWorker
>
workers
=
new
HashMap
<>();
@Setter
@Getter
private
int
topNWorkerReportCycle
=
10
;
@Setter
@Getter
private
int
topSize
=
50
;
public
static
TopNStreamProcessor
getInstance
()
{
public
static
TopNStreamProcessor
getInstance
()
{
return
PROCESSOR
;
return
PROCESSOR
;
...
@@ -63,7 +66,7 @@ public class TopNStreamProcessor implements StreamProcessor<TopN> {
...
@@ -63,7 +66,7 @@ public class TopNStreamProcessor implements StreamProcessor<TopN> {
IModelSetter
modelSetter
=
moduleDefineHolder
.
find
(
CoreModule
.
NAME
).
provider
().
getService
(
IModelSetter
.
class
);
IModelSetter
modelSetter
=
moduleDefineHolder
.
find
(
CoreModule
.
NAME
).
provider
().
getService
(
IModelSetter
.
class
);
Model
model
=
modelSetter
.
putIfAbsent
(
topNClass
,
stream
.
scopeId
(),
new
Storage
(
stream
.
name
(),
true
,
true
,
Downsampling
.
Second
),
true
);
Model
model
=
modelSetter
.
putIfAbsent
(
topNClass
,
stream
.
scopeId
(),
new
Storage
(
stream
.
name
(),
true
,
true
,
Downsampling
.
Second
),
true
);
TopNWorker
persistentWorker
=
new
TopNWorker
(
moduleDefineHolder
,
model
,
50
,
recordDAO
);
TopNWorker
persistentWorker
=
new
TopNWorker
(
moduleDefineHolder
,
model
,
topSize
,
topNWorkerReportCycle
*
60
*
1000L
,
recordDAO
);
persistentWorkers
.
add
(
persistentWorker
);
persistentWorkers
.
add
(
persistentWorker
);
workers
.
put
(
topNClass
,
persistentWorker
);
workers
.
put
(
topNClass
,
persistentWorker
);
}
}
...
...
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/worker/TopNWorker.java
浏览文件 @
5d064ced
...
@@ -46,7 +46,7 @@ public class TopNWorker extends PersistenceWorker<TopN, LimitedSizeDataCache<Top
...
@@ -46,7 +46,7 @@ public class TopNWorker extends PersistenceWorker<TopN, LimitedSizeDataCache<Top
private
volatile
long
lastReportTimestamp
;
private
volatile
long
lastReportTimestamp
;
TopNWorker
(
ModuleDefineHolder
moduleDefineHolder
,
Model
model
,
TopNWorker
(
ModuleDefineHolder
moduleDefineHolder
,
Model
model
,
int
topNSize
,
IRecordDAO
recordDAO
)
{
int
topNSize
,
long
reportCycle
,
IRecordDAO
recordDAO
)
{
super
(
moduleDefineHolder
);
super
(
moduleDefineHolder
);
this
.
limitedSizeDataCache
=
new
LimitedSizeDataCache
<>(
topNSize
);
this
.
limitedSizeDataCache
=
new
LimitedSizeDataCache
<>(
topNSize
);
this
.
recordDAO
=
recordDAO
;
this
.
recordDAO
=
recordDAO
;
...
@@ -54,8 +54,8 @@ public class TopNWorker extends PersistenceWorker<TopN, LimitedSizeDataCache<Top
...
@@ -54,8 +54,8 @@ public class TopNWorker extends PersistenceWorker<TopN, LimitedSizeDataCache<Top
this
.
dataCarrier
=
new
DataCarrier
<>(
"TopNWorker"
,
1
,
1000
);
this
.
dataCarrier
=
new
DataCarrier
<>(
"TopNWorker"
,
1
,
1000
);
this
.
dataCarrier
.
consume
(
new
TopNWorker
.
TopNConsumer
(),
1
);
this
.
dataCarrier
.
consume
(
new
TopNWorker
.
TopNConsumer
(),
1
);
this
.
lastReportTimestamp
=
System
.
currentTimeMillis
();
this
.
lastReportTimestamp
=
System
.
currentTimeMillis
();
// Top N persistent
only works per 10 minutes
.
// Top N persistent
works per 10 minutes default
.
this
.
reportCycle
=
10
*
60
*
1000L
;
this
.
reportCycle
=
reportCycle
;
}
}
@Override
public
void
cacheData
(
TopN
data
)
{
@Override
public
void
cacheData
(
TopN
data
)
{
...
...
oap-server/server-starter/src/main/assembly/application.yml
浏览文件 @
5d064ced
...
@@ -72,6 +72,7 @@ core:
...
@@ -72,6 +72,7 @@ core:
# Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
# Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
# the metrics may not be accurate within that minute.
# the metrics may not be accurate within that minute.
enableDatabaseSession
:
${SW_CORE_ENABLE_DATABASE_SESSION:true}
enableDatabaseSession
:
${SW_CORE_ENABLE_DATABASE_SESSION:true}
topNReportPeriod
:
${SW_CORE_TOPN_REPORT_PERIOD:10}
# top_n record worker report cycle, unit is minute
storage
:
storage
:
# elasticsearch:
# elasticsearch:
# nameSpace: ${SW_NAMESPACE:""}
# nameSpace: ${SW_NAMESPACE:""}
...
...
oap-server/server-starter/src/main/resources/application.yml
浏览文件 @
5d064ced
...
@@ -71,6 +71,7 @@ core:
...
@@ -71,6 +71,7 @@ core:
# Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
# Cache metric data for 1 minute to reduce database queries, and if the OAP cluster changes within that minute,
# the metrics may not be accurate within that minute.
# the metrics may not be accurate within that minute.
enableDatabaseSession
:
${SW_CORE_ENABLE_DATABASE_SESSION:true}
enableDatabaseSession
:
${SW_CORE_ENABLE_DATABASE_SESSION:true}
topNReportPeriod
:
${SW_CORE_TOPN_REPORT_PERIOD:10}
# top_n record worker report cycle, unit is minute
storage
:
storage
:
elasticsearch
:
elasticsearch
:
nameSpace
:
${SW_NAMESPACE:""}
nameSpace
:
${SW_NAMESPACE:""}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录