From 11875f948ede0a583204a3c5a7eec96c24522396 Mon Sep 17 00:00:00 2001 From: xuyong Date: Mon, 7 Mar 2022 19:44:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5hisysevent=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuyong --- .../subsystems/subsys-dfx-hisysevent-query.md | 12 +++++------- .../subsystems/subsys-dfx-hisysevent-query.md | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md b/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md index 32946d0d0e..aae1271974 100644 --- a/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md +++ b/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md @@ -17,7 +17,7 @@ HiSysEvent provides an API for you to query system events. You can query concern | API| Description| | -------- | --------- | -| bool HiSysEventManager::QueryHiSysEvent(struct QueryArg& queryArg, std::vector<struct QueryRule>& queryRules, std::shared_ptr<HiSysEventQueryCallBackBase> queryCallBack) | Queries system events by specifying search criteria such as the time segment, event domain, and event name.

Input arguments:Return value: | +| bool HiSysEventManager::QueryHiSysEvent(struct QueryArg& queryArg, std::vector<QueryRule>& queryRules, std::shared_ptr<HiSysEventQueryCallBackBase> queryCallBack) | Queries system events by specifying search criteria such as the time segment, event domain, and event name.

Input arguments:Return value: | **Table 2** Description of QueryArg @@ -30,11 +30,9 @@ HiSysEvent provides an API for you to query system events. You can query concern **Table 3** Description of QueryRule -| Attribute| Description| +| API| Description| | -------- | --------- | -| ruleType | Rule type, in the **uint32_t** format. The default value is **0**.| -| domain | Domain to which the event belongs, in the **string** format. By default, an empty string indicates that the domain is successfully matched.| -| eventList | Event name list, in the std::vector<std::string> format. By default, an empty string indicates that the event names on the list are successfully matched.| +| QueryRule(const std::string& domain, const std::vector<std::string>& eventList) | Constructor used to create a **QueryRule** object based on domain and event name list.

Input arguments: | **Table 4** Description of HiSysEventQueryCallBackBase @@ -61,7 +59,7 @@ C++ - Invoke the query API in the corresponding service logic. - HiSysEventManager::QueryHiSysEvent\(struct QueryArg& queryArg, std::vector& queryRules, std::shared\_ptr queryCallBack\) + HiSysEventManager::QueryHiSysEvent\(struct QueryArg& queryArg, std::vector& queryRules, std::shared\_ptr queryCallBack\) ``` @@ -90,7 +88,7 @@ C++ // Invoke the query callback API to obtain system events. auto queryCallBack = std::make_shared(); struct QueryArg args(clientCmdArg.beginTime, clientCmdArg.endTime, clientCmdArg.maxEvents); - std::vector mRules; + std::vector mRules; HiSysEventManager::QueryHiSysEvent(args, mRules, queryCallBack); ``` diff --git a/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-query.md b/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-query.md index 48867c40c8..60ffefa6e2 100644 --- a/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-query.md +++ b/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-query.md @@ -17,7 +17,7 @@ HiSysEvent提供了查询接口,支持开发者设置条件查询HiSysEvent事 | 接口名称 | 描述 | | -------- | --------- | -| bool HiSysEventManager::QueryHiSysEvent(struct QueryArg& queryArg, std::vector<struct QueryRule>& queryRules, std::shared_ptr<HiSysEventQueryCallBack> queryCallBack) | 接口功能:
  支持设置查询时间段,事件领域,事件名称等,查询满足条件的HiSysEvent事件。

输入参数:
  • queryArg:查询参数。
  • queryRules:事件过滤规则。
  • queryCallBack:查询接口回调对象。
返回值:
  • true:查询成功。
  • false:查询失败。
| +| bool HiSysEventManager::QueryHiSysEvent(struct QueryArg& queryArg, std::vector<QueryRule>& queryRules, std::shared_ptr<HiSysEventQueryCallBack> queryCallBack) | 接口功能:
  支持设置查询时间段,事件领域,事件名称等,查询满足条件的HiSysEvent事件。

输入参数:
  • queryArg:查询参数。
  • queryRules:事件过滤规则。
  • queryCallBack:查询接口回调对象。
返回值:
  • true:查询成功。
  • false:查询失败。
| **表 2** QueryArg查询参数对象 @@ -30,11 +30,9 @@ HiSysEvent提供了查询接口,支持开发者设置条件查询HiSysEvent事 **表 3** QueryRule查询规则对象 -| 属性名称 | 描述 | +| 接口名称 | 描述 | | -------- | --------- | -| ruleType | uint32_t类型,用来标识查询规则对象的规则类型,默认是0。 | -| domain | string类型,用来标识查询规则对象的事件所属领域,如果传入的是空字符串,则默认事件领域字段匹配成功。 | -| eventList | std::vector<std::string>类型,事件名称的列表,如果传入的是空字符串,则默认事件名称字段匹配成功。 | +| QueryRule(const std::string& domain, const std::vector<std::string>& eventList) | 接口功能:查询规则构造函数,创建查询规则对象。

输入参数:
  • domain:string类型,用来标识查询规则对象的事件所属领域,如果传入的是空字符串,则默认事件领域字段匹配成功。
  • eventList:std::vector<std::string>类型,事件名称的列表,如果传入的是空字符串,则默认事件名称字段匹配成功。
| **表 4** HiSysEventQueryCallBack查询回调对象 @@ -61,7 +59,7 @@ C++接口实例。 - 在相应的业务逻辑里面调用查询接口: - HiSysEventManager::QueryHiSysEvent\(struct QueryArg& queryArg, std::vector& queryRules, std::shared\_ptr queryCallBack\) + HiSysEventManager::QueryHiSysEvent\(struct QueryArg& queryArg, std::vector& queryRules, std::shared\_ptr queryCallBack\) ``` @@ -90,7 +88,7 @@ C++接口实例。 // 调用查询接口获取HiSysEvent事件 auto queryCallBack = std::make_shared(); struct QueryArg args(clientCmdArg.beginTime, clientCmdArg.endTime, clientCmdArg.maxEvents); - std::vector mRules; + std::vector mRules; HiSysEventManager::QueryHiSysEvent(args, mRules, queryCallBack); ``` -- GitLab