-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Monitoring Metrics to NebulaGraph #5841
Labels
good first issue
Community: perfect as the first pull request
type/feature req
Type: feature request
Comments
QingZ11
added
good first issue
Community: perfect as the first pull request
type/feature req
Type: feature request
labels
Mar 21, 2024
E2ern1ty
added a commit
to E2ern1ty/nebula
that referenced
this issue
Sep 6, 2024
E2ern1ty
added a commit
to E2ern1ty/nebula
that referenced
this issue
Sep 6, 2024
codesigner
added a commit
to E2ern1ty/nebula
that referenced
this issue
Sep 23, 2024
codesigner
pushed a commit
that referenced
this issue
Sep 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
good first issue
Community: perfect as the first pull request
type/feature req
Type: feature request
The idea was provided by @AntiTopQuark , thank you.
Requirement Description
In database systems, statistical metrics and monitoring functions are crucial for troubleshooting, especially when addressing performance issues. This requirement aims to add monitoring metrics to NebulaGraph, specifically to count the number of executions and measure the execution time of the Limit operator.
Implementation Approach
Firstly, by consulting NebulaGraph's official documentation (monitoring metrics), we can find implementations of metrics similar to our requirements, such as
num_sort_executors
, which will serve as a reference for implementing our new metric.Based on the reference information above, we can follow these steps for the code implementation of the new metric:
2.1 Define and Declare Metrics
Initially, define and declare the new metrics in the
src/graph/stats/GraphStats.h
andsrc/graph/stats/GraphStats.cpp
files, as shown below:2.2 Metric Logic Implementation
Next, implement the metric logic in
LimitExecutor.cpp
andExecutor.cpp
. This specifically includes adding a count for the number of executions during the execution of the Limit operator and calculating the execution time:Finally, using the method provided by NebulaGraph's official documentation for querying metrics, we can retrieve the results of the newly implemented metric. By executing several queries containing the Limit operator, we can further verify the accuracy of the metric.
中文版描述
为 NebulaGraph 新增监控统计项
需求描述
在数据库系统中,系统的统计项和监控功能对于排查问题至关重要,尤其是在解决性能问题时。本次需求旨在为 NebulaGraph 新增监控统计项,具体为统计
Limit
算子的执行次数及其执行时间。实现思路
首先,通过查阅 NebulaGraph 的官方文档(监控统计项),我们可以找到与我们需求相似的统计项实现,例如
num_sort_executors
,作为我们实现新统计项的参考。基于上述参考信息,我们可以按照以下步骤进行新统计项的代码实现:
2.1 定义和声明统计项
首先,在
src/graph/stats/GraphStats.h
和src/graph/stats/GraphStats.cpp
文件中定义并声明新的统计项,如下所示:2.2 统计项逻辑实现
接着,在
LimitExecutor.cpp
和Executor.cpp
中实现统计逻辑,具体包括在执行Limit
算子时增加执行次数的统计,并计算执行时间:最后,按照 NebulaGraph 官方提供的统计项查询方法,我们可以获取新实现的统计项结果。通过执行几条包含
Limit
算子的查询语句,进一步验证统计项的准确性。The text was updated successfully, but these errors were encountered: