Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
3c62acde
M
milvus
项目概览
milvus
/
milvus
9 个月 前同步成功
通知
260
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
3c62acde
编写于
8月 17, 2023
作者:
Y
yihao.dai
提交者:
GitHub
8月 17, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add coll and segState lebels to DataCoordNumStoredRows monitoring (#26299)
Signed-off-by:
N
bigsheeper
<
yihao.dai@zilliz.com
>
上级
ba806429
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
7 deletion
+30
-7
internal/datacoord/meta.go
internal/datacoord/meta.go
+10
-3
internal/datacoord/services.go
internal/datacoord/services.go
+4
-0
pkg/metrics/datacoord_metrics.go
pkg/metrics/datacoord_metrics.go
+16
-4
未找到文件。
internal/datacoord/meta.go
浏览文件 @
3c62acde
...
...
@@ -111,7 +111,6 @@ func (m *meta) reloadFromKV() error {
metrics
.
DataCoordNumSegments
.
WithLabelValues
(
metrics
.
FlushedSegmentLabel
)
.
Set
(
0
)
metrics
.
DataCoordNumSegments
.
WithLabelValues
(
metrics
.
FlushingSegmentLabel
)
.
Set
(
0
)
metrics
.
DataCoordNumSegments
.
WithLabelValues
(
metrics
.
DroppedSegmentLabel
)
.
Set
(
0
)
metrics
.
DataCoordNumStoredRows
.
WithLabelValues
()
.
Set
(
0
)
numStoredRows
:=
int64
(
0
)
for
_
,
segment
:=
range
segments
{
m
.
segments
.
SetSegment
(
segment
.
ID
,
NewSegmentInfo
(
segment
))
...
...
@@ -138,7 +137,6 @@ func (m *meta) reloadFromKV() error {
metrics
.
FlushedSegmentFileNum
.
WithLabelValues
(
metrics
.
DeleteFileLabel
)
.
Observe
(
float64
(
deleteFileNum
))
}
}
metrics
.
DataCoordNumStoredRows
.
WithLabelValues
()
.
Set
(
float64
(
numStoredRows
))
metrics
.
DataCoordNumStoredRowsCounter
.
WithLabelValues
()
.
Add
(
float64
(
numStoredRows
))
channelCPs
,
err
:=
m
.
catalog
.
ListChannelCheckpoint
(
m
.
ctx
)
...
...
@@ -274,6 +272,7 @@ func (m *meta) GetCollectionBinlogSize() (int64, map[UniqueID]int64) {
m
.
RLock
()
defer
m
.
RUnlock
()
collectionBinlogSize
:=
make
(
map
[
UniqueID
]
int64
)
collectionRowsNum
:=
make
(
map
[
UniqueID
]
map
[
commonpb
.
SegmentState
]
int64
)
segments
:=
m
.
segments
.
GetSegments
()
var
total
int64
for
_
,
segment
:=
range
segments
{
...
...
@@ -283,6 +282,15 @@ func (m *meta) GetCollectionBinlogSize() (int64, map[UniqueID]int64) {
collectionBinlogSize
[
segment
.
GetCollectionID
()]
+=
segmentSize
metrics
.
DataCoordStoredBinlogSize
.
WithLabelValues
(
fmt
.
Sprint
(
segment
.
GetCollectionID
()),
fmt
.
Sprint
(
segment
.
GetID
()))
.
Set
(
float64
(
segmentSize
))
if
_
,
ok
:=
collectionRowsNum
[
segment
.
GetCollectionID
()];
!
ok
{
collectionRowsNum
[
segment
.
GetCollectionID
()]
=
make
(
map
[
commonpb
.
SegmentState
]
int64
)
}
collectionRowsNum
[
segment
.
GetCollectionID
()][
segment
.
GetState
()]
+=
segment
.
GetNumOfRows
()
}
}
for
collection
,
statesRows
:=
range
collectionRowsNum
{
for
state
,
rows
:=
range
statesRows
{
metrics
.
DataCoordNumStoredRows
.
WithLabelValues
(
fmt
.
Sprint
(
collection
),
state
.
String
())
.
Set
(
float64
(
rows
))
}
}
return
total
,
collectionBinlogSize
...
...
@@ -1316,7 +1324,6 @@ func (s *segMetricMutation) commit() {
for
state
,
change
:=
range
s
.
stateChange
{
metrics
.
DataCoordNumSegments
.
WithLabelValues
(
state
)
.
Add
(
float64
(
change
))
}
metrics
.
DataCoordNumStoredRows
.
WithLabelValues
()
.
Add
(
float64
(
s
.
rowCountChange
))
metrics
.
DataCoordNumStoredRowsCounter
.
WithLabelValues
()
.
Add
(
float64
(
s
.
rowCountAccChange
))
}
...
...
internal/datacoord/services.go
浏览文件 @
3c62acde
...
...
@@ -527,6 +527,7 @@ func (s *Server) DropVirtualChannel(ctx context.Context, req *datapb.DropVirtual
return
resp
,
nil
}
var
collectionID
int64
segments
:=
make
([]
*
SegmentInfo
,
0
,
len
(
req
.
GetSegments
()))
for
_
,
seg2Drop
:=
range
req
.
GetSegments
()
{
info
:=
&
datapb
.
SegmentInfo
{
...
...
@@ -542,6 +543,7 @@ func (s *Server) DropVirtualChannel(ctx context.Context, req *datapb.DropVirtual
}
segment
:=
NewSegmentInfo
(
info
)
segments
=
append
(
segments
,
segment
)
collectionID
=
seg2Drop
.
GetCollectionID
()
}
err
:=
s
.
meta
.
UpdateDropChannelSegmentInfo
(
channel
,
segments
)
...
...
@@ -558,6 +560,8 @@ func (s *Server) DropVirtualChannel(ctx context.Context, req *datapb.DropVirtual
}
s
.
segmentManager
.
DropSegmentsOfChannel
(
ctx
,
channel
)
metrics
.
CleanupDataCoordNumStoredRows
(
collectionID
)
// no compaction triggered in Drop procedure
resp
.
Status
.
ErrorCode
=
commonpb
.
ErrorCode_Success
return
resp
,
nil
...
...
pkg/metrics/datacoord_metrics.go
浏览文件 @
3c62acde
...
...
@@ -19,9 +19,9 @@ package metrics
import
(
"fmt"
"github.com/prometheus/client_golang/prometheus"
"github.com/milvus-io/milvus-proto/go-api/v2/commonpb"
"github.com/milvus-io/milvus/pkg/util/typeutil"
"github.com/prometheus/client_golang/prometheus"
)
const
(
...
...
@@ -74,8 +74,11 @@ var (
Namespace
:
milvusNamespace
,
Subsystem
:
typeutil
.
DataCoordRole
,
Name
:
"stored_rows_num"
,
Help
:
"number of stored rows"
,
},
[]
string
{})
Help
:
"number of stored rows of healthy segment"
,
},
[]
string
{
collectionIDLabelName
,
segmentStateLabelName
,
})
DataCoordNumStoredRowsCounter
=
prometheus
.
NewCounterVec
(
prometheus
.
CounterOpts
{
...
...
@@ -248,3 +251,12 @@ func CleanupDataCoordSegmentMetrics(collectionID int64, segmentID int64) {
segmentIDLabelName
:
fmt
.
Sprint
(
segmentID
),
})
}
func
CleanupDataCoordNumStoredRows
(
collectionID
int64
)
{
for
_
,
state
:=
range
commonpb
.
SegmentState_name
{
DataCoordNumStoredRows
.
Delete
(
prometheus
.
Labels
{
collectionIDLabelName
:
fmt
.
Sprint
(
collectionID
),
segmentStateLabelName
:
fmt
.
Sprint
(
state
),
})
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录