Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Zero.Ki
Pinpoint
提交
839aeb80
P
Pinpoint
项目概览
Zero.Ki
/
Pinpoint
通知
4
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Pinpoint
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
839aeb80
编写于
3月 03, 2021
作者:
W
Woonduk Kang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[#7659] Cleanup BulkOperation
上级
b28a2149
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
71 addition
and
29 deletion
+71
-29
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/HbaseMapResponseTimeDao.java
...pinpoint/collector/dao/hbase/HbaseMapResponseTimeDao.java
+14
-5
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/HbaseMapStatisticsCalleeDao.java
...oint/collector/dao/hbase/HbaseMapStatisticsCalleeDao.java
+14
-8
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/HbaseMapStatisticsCallerDao.java
...oint/collector/dao/hbase/HbaseMapStatisticsCallerDao.java
+15
-6
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/statistics/BulkConfiguration.java
...int/collector/dao/hbase/statistics/BulkConfiguration.java
+2
-9
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/statistics/MapLinkConfiguration.java
.../collector/dao/hbase/statistics/MapLinkConfiguration.java
+24
-0
collector/src/main/resources/pinpoint-collector-root.properties
...tor/src/main/resources/pinpoint-collector-root.properties
+2
-1
未找到文件。
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/HbaseMapResponseTimeDao.java
浏览文件 @
839aeb80
...
...
@@ -20,6 +20,7 @@ import com.navercorp.pinpoint.collector.dao.MapResponseTimeDao;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.BulkWriter
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.CallRowKey
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.ColumnName
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.MapLinkConfiguration
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.ResponseColumnName
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.RowKey
;
import
com.navercorp.pinpoint.common.profiler.util.ApplicationMapStatisticsUtils
;
...
...
@@ -52,10 +53,13 @@ public class HbaseMapResponseTimeDao implements MapResponseTimeDao {
private
final
TimeSlot
timeSlot
;
private
final
BulkWriter
bulkWriter
;
private
final
MapLinkConfiguration
mapLinkConfiguration
;
@Autowired
public
HbaseMapResponseTimeDao
(
AcceptedTimeService
acceptedTimeService
,
TimeSlot
timeSlot
,
public
HbaseMapResponseTimeDao
(
MapLinkConfiguration
mapLinkConfiguration
,
AcceptedTimeService
acceptedTimeService
,
TimeSlot
timeSlot
,
@Qualifier
(
"selfBulkWriter"
)
BulkWriter
bulkWriter
)
{
this
.
mapLinkConfiguration
=
Objects
.
requireNonNull
(
mapLinkConfiguration
,
"mapLinkConfiguration"
);
this
.
acceptedTimeService
=
Objects
.
requireNonNull
(
acceptedTimeService
,
"acceptedTimeService"
);
this
.
timeSlot
=
Objects
.
requireNonNull
(
timeSlot
,
"timeSlot"
);
this
.
bulkWriter
=
Objects
.
requireNonNull
(
bulkWriter
,
"bulkWrtier"
);
...
...
@@ -80,12 +84,17 @@ public class HbaseMapResponseTimeDao implements MapResponseTimeDao {
final
ColumnName
selfColumnName
=
new
ResponseColumnName
(
agentId
,
slotNumber
);
HistogramSchema
histogramSchema
=
applicationServiceType
.
getHistogramSchema
();
final
ColumnName
sumColumnName
=
new
ResponseColumnName
(
agentId
,
histogramSchema
.
getSumStatSlot
().
getSlotTime
());
final
ColumnName
maxColumnName
=
new
ResponseColumnName
(
agentId
,
histogramSchema
.
getMaxStatSlot
().
getSlotTime
());
final
ColumnName
maxColumnName
=
new
ResponseColumnName
(
agentId
,
histogramSchema
.
getMaxStatSlot
().
getSlotTime
());
this
.
bulkWriter
.
increment
(
selfRowKey
,
selfColumnName
);
this
.
bulkWriter
.
increment
(
selfRowKey
,
sumColumnName
,
elapsed
);
this
.
bulkWriter
.
updateMax
(
selfRowKey
,
maxColumnName
,
elapsed
);
if
(
mapLinkConfiguration
.
isEnableAvg
())
{
final
ColumnName
sumColumnName
=
new
ResponseColumnName
(
agentId
,
histogramSchema
.
getSumStatSlot
().
getSlotTime
());
this
.
bulkWriter
.
increment
(
selfRowKey
,
sumColumnName
,
elapsed
);
}
if
(
mapLinkConfiguration
.
isEnableMax
())
{
this
.
bulkWriter
.
updateMax
(
selfRowKey
,
maxColumnName
,
elapsed
);
}
}
...
...
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/HbaseMapStatisticsCalleeDao.java
浏览文件 @
839aeb80
...
...
@@ -21,6 +21,7 @@ import com.navercorp.pinpoint.collector.dao.hbase.statistics.BulkWriter;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.CallRowKey
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.CallerColumnName
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.ColumnName
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.MapLinkConfiguration
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.RowKey
;
import
com.navercorp.pinpoint.common.profiler.util.ApplicationMapStatisticsUtils
;
import
com.navercorp.pinpoint.common.server.util.AcceptedTimeService
;
...
...
@@ -54,12 +55,15 @@ public class HbaseMapStatisticsCalleeDao implements MapStatisticsCalleeDao {
private
final
IgnoreStatFilter
ignoreStatFilter
;
private
final
BulkWriter
bulkWriter
;
private
final
MapLinkConfiguration
mapLinkConfiguration
;
@Autowired
public
HbaseMapStatisticsCalleeDao
(
IgnoreStatFilter
ignoreStatFilter
,
public
HbaseMapStatisticsCalleeDao
(
MapLinkConfiguration
mapLinkConfiguration
,
IgnoreStatFilter
ignoreStatFilter
,
AcceptedTimeService
acceptedTimeService
,
TimeSlot
timeSlot
,
@Qualifier
(
"calleeBulkWriter"
)
BulkWriter
bulkWriter
)
{
this
.
mapLinkConfiguration
=
Objects
.
requireNonNull
(
mapLinkConfiguration
,
"mapLinkConfiguration"
);
this
.
ignoreStatFilter
=
Objects
.
requireNonNull
(
ignoreStatFilter
,
"ignoreStatFilter"
);
this
.
acceptedTimeService
=
Objects
.
requireNonNull
(
acceptedTimeService
,
"acceptedTimeService"
);
this
.
timeSlot
=
Objects
.
requireNonNull
(
timeSlot
,
"timeSlot"
);
...
...
@@ -94,16 +98,20 @@ public class HbaseMapStatisticsCalleeDao implements MapStatisticsCalleeDao {
final
RowKey
calleeRowKey
=
new
CallRowKey
(
calleeApplicationName
,
calleeServiceType
.
getCode
(),
rowTimeSlot
);
final
short
callerSlotNumber
=
ApplicationMapStatisticsUtils
.
getSlotNumber
(
calleeServiceType
,
elapsed
,
isError
);
final
ColumnName
callerColumnName
=
new
CallerColumnName
(
callerServiceType
.
getCode
(),
callerApplicationName
,
callerHost
,
callerSlotNumber
);
HistogramSchema
histogramSchema
=
calleeServiceType
.
getHistogramSchema
();
final
ColumnName
sumColumnName
=
new
CallerColumnName
(
callerServiceType
.
getCode
(),
callerApplicationName
,
callerHost
,
histogramSchema
.
getSumStatSlot
().
getSlotTime
());
final
ColumnName
maxColumnName
=
new
CallerColumnName
(
callerServiceType
.
getCode
(),
callerApplicationName
,
callerHost
,
histogramSchema
.
getMaxStatSlot
().
getSlotTime
());
final
ColumnName
callerColumnName
=
new
CallerColumnName
(
callerServiceType
.
getCode
(),
callerApplicationName
,
callerHost
,
callerSlotNumber
);
this
.
bulkWriter
.
increment
(
calleeRowKey
,
callerColumnName
);
this
.
bulkWriter
.
increment
(
calleeRowKey
,
sumColumnName
,
elapsed
);
this
.
bulkWriter
.
updateMax
(
calleeRowKey
,
maxColumnName
,
elapsed
);
if
(
mapLinkConfiguration
.
isEnableAvg
())
{
final
ColumnName
sumColumnName
=
new
CallerColumnName
(
callerServiceType
.
getCode
(),
callerApplicationName
,
callerHost
,
histogramSchema
.
getSumStatSlot
().
getSlotTime
());
this
.
bulkWriter
.
increment
(
calleeRowKey
,
sumColumnName
,
elapsed
);
}
if
(
mapLinkConfiguration
.
isEnableMax
())
{
final
ColumnName
maxColumnName
=
new
CallerColumnName
(
callerServiceType
.
getCode
(),
callerApplicationName
,
callerHost
,
histogramSchema
.
getMaxStatSlot
().
getSlotTime
());
this
.
bulkWriter
.
updateMax
(
calleeRowKey
,
maxColumnName
,
elapsed
);
}
}
...
...
@@ -117,6 +125,4 @@ public class HbaseMapStatisticsCalleeDao implements MapStatisticsCalleeDao {
this
.
bulkWriter
.
flushAvgMax
();
}
}
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/HbaseMapStatisticsCallerDao.java
浏览文件 @
839aeb80
...
...
@@ -21,6 +21,7 @@ import com.navercorp.pinpoint.collector.dao.hbase.statistics.BulkWriter;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.CallRowKey
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.CalleeColumnName
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.ColumnName
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.MapLinkConfiguration
;
import
com.navercorp.pinpoint.collector.dao.hbase.statistics.RowKey
;
import
com.navercorp.pinpoint.common.profiler.util.ApplicationMapStatisticsUtils
;
import
com.navercorp.pinpoint.common.server.util.AcceptedTimeService
;
...
...
@@ -52,12 +53,15 @@ public class HbaseMapStatisticsCallerDao implements MapStatisticsCallerDao {
private
final
TimeSlot
timeSlot
;
private
final
BulkWriter
bulkWriter
;
private
final
MapLinkConfiguration
mapLinkConfiguration
;
@Autowired
public
HbaseMapStatisticsCallerDao
(
AcceptedTimeService
acceptedTimeService
,
public
HbaseMapStatisticsCallerDao
(
MapLinkConfiguration
mapLinkConfiguration
,
AcceptedTimeService
acceptedTimeService
,
TimeSlot
timeSlot
,
@Qualifier
(
"callerBulkWriter"
)
BulkWriter
bulkWriter
)
{
this
.
mapLinkConfiguration
=
Objects
.
requireNonNull
(
mapLinkConfiguration
,
"mapLinkConfiguration"
);
this
.
acceptedTimeService
=
Objects
.
requireNonNull
(
acceptedTimeService
,
"acceptedTimeService"
);
this
.
timeSlot
=
Objects
.
requireNonNull
(
timeSlot
,
"timeSlot"
);
...
...
@@ -85,15 +89,20 @@ public class HbaseMapStatisticsCallerDao implements MapStatisticsCallerDao {
final
RowKey
callerRowKey
=
new
CallRowKey
(
callerApplicationName
,
callerServiceType
.
getCode
(),
rowTimeSlot
);
final
short
calleeSlotNumber
=
ApplicationMapStatisticsUtils
.
getSlotNumber
(
calleeServiceType
,
elapsed
,
isError
);
final
ColumnName
calleeColumnName
=
new
CalleeColumnName
(
callerAgentid
,
calleeServiceType
.
getCode
(),
calleeApplicationName
,
calleeHost
,
calleeSlotNumber
);
HistogramSchema
histogramSchema
=
callerServiceType
.
getHistogramSchema
();
final
ColumnName
sumColumnName
=
new
CalleeColumnName
(
callerAgentid
,
calleeServiceType
.
getCode
(),
calleeApplicationName
,
calleeHost
,
histogramSchema
.
getSumStatSlot
().
getSlotTime
());
final
ColumnName
maxColumnName
=
new
CalleeColumnName
(
callerAgentid
,
calleeServiceType
.
getCode
(),
calleeApplicationName
,
calleeHost
,
histogramSchema
.
getMaxStatSlot
().
getSlotTime
());
final
ColumnName
calleeColumnName
=
new
CalleeColumnName
(
callerAgentid
,
calleeServiceType
.
getCode
(),
calleeApplicationName
,
calleeHost
,
calleeSlotNumber
);
this
.
bulkWriter
.
increment
(
callerRowKey
,
calleeColumnName
);
this
.
bulkWriter
.
increment
(
callerRowKey
,
sumColumnName
,
elapsed
);
this
.
bulkWriter
.
updateMax
(
callerRowKey
,
maxColumnName
,
elapsed
);
if
(
mapLinkConfiguration
.
isEnableAvg
())
{
final
ColumnName
sumColumnName
=
new
CalleeColumnName
(
callerAgentid
,
calleeServiceType
.
getCode
(),
calleeApplicationName
,
calleeHost
,
histogramSchema
.
getSumStatSlot
().
getSlotTime
());
this
.
bulkWriter
.
increment
(
callerRowKey
,
sumColumnName
,
elapsed
);
}
if
(
mapLinkConfiguration
.
isEnableMax
())
{
final
ColumnName
maxColumnName
=
new
CalleeColumnName
(
callerAgentid
,
calleeServiceType
.
getCode
(),
calleeApplicationName
,
calleeHost
,
histogramSchema
.
getMaxStatSlot
().
getSlotTime
());
this
.
bulkWriter
.
updateMax
(
callerRowKey
,
maxColumnName
,
elapsed
);
}
}
...
...
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/statistics/BulkConfiguration.java
浏览文件 @
839aeb80
...
...
@@ -36,18 +36,16 @@ public class BulkConfiguration {
private
final
int
selfLimitSize
;
private
final
boolean
enableBulk
;
private
final
boolean
enableAvgMax
;
public
BulkConfiguration
(
@Value
(
"${collector.cachedStatDao.caller.limit:-1}"
)
int
callerLimitSize
,
@Value
(
"${collector.cachedStatDao.callee.limit:-1}"
)
int
calleeLimitSize
,
@Value
(
"${collector.cachedStatDao.self.limit:-1}"
)
int
selfLimitSize
,
@Value
(
"${collector.cachedStatDao.bulk.enable:true}"
)
boolean
enableBulk
,
@Value
(
"${collector.cachedStatDao.avg-max.enable:true}"
)
boolean
enableAvgMax
)
{
@Value
(
"${collector.cachedStatDao.bulk.enable:true}"
)
boolean
enableBulk
)
{
this
.
callerLimitSize
=
callerLimitSize
;
this
.
calleeLimitSize
=
calleeLimitSize
;
this
.
selfLimitSize
=
selfLimitSize
;
this
.
enableBulk
=
enableBulk
;
this
.
enableAvgMax
=
enableAvgMax
;
}
public
int
getCallerLimitSize
()
{
...
...
@@ -66,10 +64,6 @@ public class BulkConfiguration {
return
enableBulk
;
}
public
boolean
enableAvgMax
()
{
return
enableAvgMax
;
}
@PostConstruct
public
void
log
()
{
logger
.
info
(
"{}"
,
this
);
...
...
@@ -82,7 +76,6 @@ public class BulkConfiguration {
", calleeLimitSize="
+
calleeLimitSize
+
", selfLimitSize="
+
selfLimitSize
+
", enableBulk="
+
enableBulk
+
", enableAvgMax="
+
enableAvgMax
+
'}'
;
}
}
collector/src/main/java/com/navercorp/pinpoint/collector/dao/hbase/statistics/MapLinkConfiguration.java
0 → 100644
浏览文件 @
839aeb80
package
com.navercorp.pinpoint.collector.dao.hbase.statistics
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Component
public
class
MapLinkConfiguration
{
private
final
boolean
enableAvg
;
private
final
boolean
enableMax
;
public
MapLinkConfiguration
(
@Value
(
"${collector.map-link.avg.enable:true}"
)
boolean
enableAvg
,
@Value
(
"${collector.map-link.max.enable:true}"
)
boolean
enableMax
)
{
this
.
enableAvg
=
enableAvg
;
this
.
enableMax
=
enableMax
;
}
public
boolean
isEnableAvg
()
{
return
enableAvg
;
}
public
boolean
isEnableMax
()
{
return
enableMax
;
}
}
collector/src/main/resources/pinpoint-collector-root.properties
浏览文件 @
839aeb80
...
...
@@ -135,7 +135,8 @@ collector.cachedStatDao.caller.limit=-1
collector.cachedStatDao.callee.limit
=
-1
collector.cachedStatDao.self.limit
=
-1
collector.cachedStatDao.bulk.enable
=
true
collector.cachedStatDao.avg-max.enable
=
true
collector.map-link.avg.enable
=
true
collector.map-link.max.enable
=
true
# Flink configuration
flink.cluster.enable
=
false
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录