Signed-off-by: junyi233 <zhengjun29@huawei.com>
This commit is contained in:
junyi233 2024-05-13 14:26:09 +08:00
parent e2f3ffae74
commit 02bdba095f
3 changed files with 78 additions and 2 deletions

View File

@ -11,13 +11,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
domain: BUNDLE_MANAGER
domain: BUNDLEMANAGER_UE
################################################################################
# FAULT EVENT #
################################################################################
BUNDLE_INSTALL_EXCEPTION:
__BASE: {type: FAULT, level: MINOR, desc: used to fault happened when bundle install}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
VERSION: {type: UINT32, desc: versionCode}
@ -27,6 +29,8 @@ BUNDLE_INSTALL_EXCEPTION:
BUNDLE_UNINSTALL_EXCEPTION:
__BASE: {type: FAULT, level: MINOR, desc: used to fault happened when bundle uninstall}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
VERSION: {type: UINT32, desc: versionCode}
@ -35,6 +39,8 @@ BUNDLE_UNINSTALL_EXCEPTION:
BUNDLE_UPDATE_EXCEPTION:
__BASE: {type: FAULT, level: MINOR, desc: used to fault happened when bundle update}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
VERSION: {type: UINT32, desc: versionCode}
@ -43,6 +49,8 @@ BUNDLE_UPDATE_EXCEPTION:
PRE_BUNDLE_RECOVER_EXCEPTION:
__BASE: {type: FAULT, level: MINOR, desc: used to fault happened when prebundle recover}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
VERSION: {type: UINT32, desc: versionCode}
@ -51,6 +59,8 @@ PRE_BUNDLE_RECOVER_EXCEPTION:
BUNDLE_STATE_CHANGE_EXCEPTION:
__BASE: {type: FAULT, level: MINOR, desc: used to fault happened when state change}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
ABILITY_NAME: {type: STRING, desc: abilityName}
@ -58,6 +68,8 @@ BUNDLE_STATE_CHANGE_EXCEPTION:
BUNDLE_CLEAN_CACHE_EXCEPTION:
__BASE: {type: FAULT, level: MINOR, desc: used to fault happened when clean cache or clean data}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
CLEAN_TYPE: {type: STRING, desc: clean cache or clean data}
@ -67,14 +79,20 @@ BUNDLE_CLEAN_CACHE_EXCEPTION:
################################################################################
BOOT_SCAN_START:
__BASE: {type: BEHAVIOR, level: MINOR, desc: boot scan start}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
TIME: {type: INT64, desc: time stamp}
BOOT_SCAN_END:
__BASE: {type: BEHAVIOR, level: MINOR, desc: boot scan end}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
TIME: {type: INT64, desc: time stamp}
BUNDLE_INSTALL:
__BASE: {type: BEHAVIOR, level: MINOR, desc: bundle install}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
VERSION: {type: UINT32, desc: versionCode}
@ -92,6 +110,8 @@ BUNDLE_INSTALL:
BUNDLE_UNINSTALL:
__BASE: {type: BEHAVIOR, level: MINOR, desc: bundle uninstall}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
VERSION: {type: UINT32, desc: versionCode}
@ -102,6 +122,8 @@ BUNDLE_UNINSTALL:
BUNDLE_UPDATE:
__BASE: {type: BEHAVIOR, level: MINOR, desc: bundle update}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
VERSION: {type: UINT32, desc: versionCode}
@ -118,6 +140,8 @@ BUNDLE_UPDATE:
PRE_BUNDLE_RECOVER:
__BASE: {type: BEHAVIOR, level: MINOR, desc: prebundle recover}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
VERSION: {type: UINT32, desc: versionCode}
@ -134,6 +158,8 @@ PRE_BUNDLE_RECOVER:
BUNDLE_STATE_CHANGE:
__BASE: {type: BEHAVIOR, level: MINOR, desc: bundle or component disable or enable}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
ABILITY_NAME: {type: STRING, desc: abilityName}
@ -142,12 +168,16 @@ BUNDLE_STATE_CHANGE:
BUNDLE_CLEAN_CACHE:
__BASE: {type: BEHAVIOR, level: MINOR, desc: bundle clean cache}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
USERID: {type: INT32, desc: userId of the bundle}
BUNDLE_NAME: {type: STRING, desc: bundleName}
CLEAN_TYPE: {type: STRING, desc: clean cache or clean data}
GET_REMOTE_ABILITY_INFO:
__BASE: {type: BEHAVIOR, level: MINOR, desc: get remote abilityInfo}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
DEVICE_ID: {type: STRING, desc: deviceId}
BUNDLE_NAME: {type: STRING, desc: bundleName}
LOCALE_INFO: {type: STRING, desc: localeInfo}
@ -156,6 +186,8 @@ GET_REMOTE_ABILITY_INFO:
GET_REMOTE_ABILITY_INFOS:
__BASE: {type: BEHAVIOR, level: MINOR, desc: get remote abilityInfos}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
DEVICE_ID: {type: STRING, desc: deviceId}
BUNDLE_NAME: {type: STRING, desc: bundleName}
LOCALE_INFO: {type: STRING, desc: localeInfo}
@ -164,12 +196,16 @@ GET_REMOTE_ABILITY_INFOS:
BMS_USER_EVENT:
__BASE: {type: BEHAVIOR, level: MINOR, desc: user event}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
TYPE: {type: STRING, desc: user event type}
USERID: {type: INT32, desc: userId of the bundle}
TIME: {type: INT64, desc: time stamp}
BUNDLE_QUICK_FIX:
__BASE: {type: BEHAVIOR, level: MINOR, desc: bundle apply quick fix}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
BUNDLE_NAME: {type: STRING, desc: bundleName}
APP_DISTRIBUTION_TYPE: {type: STRING, desc: app distribution type}
APPLY_QUICK_FIX_FREQUENCY: {type: INT32, desc: apply quick fix frequency}
@ -178,6 +214,8 @@ BUNDLE_QUICK_FIX:
QUERY_OF_CONTINUE_TYPE:
__BASE: {type: BEHAVIOR, level: MINOR, desc: query abilityInfo by continuetype and bundleName}
PNAMEID: {type: STRING, desc: package name}
PVERSIONID: {type: STRING, desc: application version}
BUNDLE_NAME: {type: STRING, desc: bundleName}
ABILITY_NAME: {type: STRING, desc: abilityName}
CONTINUE_TYPE: {type: STRING, desc: continueType}

View File

@ -87,6 +87,8 @@ struct EventInfo {
std::string bundleName;
std::string moduleName;
std::string abilityName;
std::string packageName;
std::string applicationVersion;
int64_t timeStamp = 0;
uint32_t versionCode = 0;
@ -139,6 +141,8 @@ struct EventInfo {
bundleName.clear();
moduleName.clear();
abilityName.clear();
packageName.clear();
applicationVersion.clear();
versionCode = 0;
timeStamp = 0;
preBundleScene = InstallScene::NORMAL;

View File

@ -45,6 +45,8 @@ const std::string ACCESSTOKEN_PROCESS_NAME = "accesstoken_service";
static constexpr char PERFORMANCE_DOMAIN[] = "PERFORMANCE";
// event params
const std::string EVENT_PARAM_PNAMEID = "PNAMEID";
const std::string EVENT_PARAM_PVERSIONID = "PVERSIONID";
const std::string EVENT_PARAM_USERID = "USERID";
const std::string EVENT_PARAM_UID = "UID";
const std::string EVENT_PARAM_BUNDLE_NAME = "BUNDLE_NAME";
@ -251,6 +253,8 @@ void InnerEventReport::InnerSendBundleInstallExceptionEvent(const EventInfo& eve
InnerEventWrite(
BUNDLE_INSTALL_EXCEPTION,
HiSysEventType::FAULT,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_VERSION, eventInfo.versionCode,
@ -264,6 +268,8 @@ void InnerEventReport::InnerSendBundleUninstallExceptionEvent(const EventInfo& e
InnerEventWrite(
BUNDLE_UNINSTALL_EXCEPTION,
HiSysEventType::FAULT,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_VERSION, eventInfo.versionCode,
@ -276,6 +282,8 @@ void InnerEventReport::InnerSendBundleUpdateExceptionEvent(const EventInfo& even
InnerEventWrite(
BUNDLE_UPDATE_EXCEPTION,
HiSysEventType::FAULT,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_VERSION, eventInfo.versionCode,
@ -288,6 +296,8 @@ void InnerEventReport::InnerSendPreBundleRecoverExceptionEvent(const EventInfo&
InnerEventWrite(
PRE_BUNDLE_RECOVER_EXCEPTION,
HiSysEventType::FAULT,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_VERSION, eventInfo.versionCode,
@ -301,6 +311,8 @@ void InnerEventReport::InnerSendBundleStateChangeExceptionEvent(const EventInfo&
InnerEventWrite(
BUNDLE_STATE_CHANGE_EXCEPTION,
HiSysEventType::FAULT,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_ABILITY_NAME, eventInfo.abilityName,
@ -313,6 +325,8 @@ void InnerEventReport::InnerSendBundleCleanCacheExceptionEvent(const EventInfo&
InnerEventWrite(
BUNDLE_CLEAN_CACHE_EXCEPTION,
HiSysEventType::FAULT,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_CLEAN_TYPE, cleanType);
@ -323,6 +337,8 @@ void InnerEventReport::InnerSendBootScanStartEvent(const EventInfo& eventInfo)
InnerEventWrite(
BOOT_SCAN_START,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_TIME, eventInfo.timeStamp);
}
@ -331,6 +347,8 @@ void InnerEventReport::InnerSendBootScanEndEvent(const EventInfo& eventInfo)
InnerEventWrite(
BOOT_SCAN_END,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_TIME, eventInfo.timeStamp);
}
@ -339,6 +357,8 @@ void InnerEventReport::InnerSendBundleInstallEvent(const EventInfo& eventInfo)
InnerEventWrite(
BUNDLE_INSTALL,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_VERSION, eventInfo.versionCode,
@ -360,6 +380,8 @@ void InnerEventReport::InnerSendBundleUninstallEvent(const EventInfo& eventInfo)
InnerEventWrite(
BUNDLE_UNINSTALL,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_VERSION, eventInfo.versionCode,
@ -374,6 +396,8 @@ void InnerEventReport::InnerSendBundleUpdateEvent(const EventInfo& eventInfo)
InnerEventWrite(
BUNDLE_UPDATE,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_VERSION, eventInfo.versionCode,
@ -394,6 +418,8 @@ void InnerEventReport::InnerSendPreBundleRecoverEvent(const EventInfo& eventInfo
InnerEventWrite(
PRE_BUNDLE_RECOVER,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_VERSION, eventInfo.versionCode,
@ -414,6 +440,8 @@ void InnerEventReport::InnerSendBundleStateChangeEvent(const EventInfo& eventInf
InnerEventWrite(
BUNDLE_STATE_CHANGE,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_ABILITY_NAME, eventInfo.abilityName,
@ -427,6 +455,8 @@ void InnerEventReport::InnerSendBundleCleanCacheEvent(const EventInfo& eventInfo
InnerEventWrite(
BUNDLE_CLEAN_CACHE,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_CLEAN_TYPE, cleanType);
@ -437,6 +467,8 @@ void InnerEventReport::InnerSendUserEvent(const EventInfo& eventInfo)
InnerEventWrite(
BMS_USER_EVENT,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
TYPE, GetUserEventType(eventInfo),
EVENT_PARAM_USERID, eventInfo.userId,
EVENT_PARAM_TIME, eventInfo.timeStamp);
@ -447,6 +479,8 @@ void InnerEventReport::InnerSendQuickFixEvent(const EventInfo& eventInfo)
InnerEventWrite(
BUNDLE_QUICK_FIX,
HiSysEventType::BEHAVIOR,
EVENT_PARAM_PNAMEID, eventInfo.packageName,
EVENT_PARAM_PVERSIONID, eventInfo.applicationVersion,
EVENT_PARAM_BUNDLE_NAME, eventInfo.bundleName,
EVENT_PARAM_APP_DISTRIBUTION_TYPE, eventInfo.appDistributionType,
EVENT_PARAM_APPLY_QUICK_FIX_FREQUENCY, eventInfo.applyQuickFixFrequency,
@ -510,7 +544,7 @@ void InnerEventReport::InnerEventWrite(
Types... keyValues)
{
HiSysEventWrite(
OHOS::HiviewDFX::HiSysEvent::Domain::BUNDLE_MANAGER,
OHOS::HiviewDFX::HiSysEvent::Domain::BUNDLEMANAGER_UE,
eventName,
static_cast<OHOS::HiviewDFX::HiSysEvent::EventType>(type),
keyValues...);