端到端打点,增加事务级prepareTraceId

Signed-off-by: zhangshuyi <zhangshuyi14@huawei.com>
This commit is contained in:
zhangshuyi 2024-09-27 10:02:47 +08:00
parent 8038b2c4a0
commit 371e28d868
9 changed files with 20 additions and 10 deletions

View File

@ -26,7 +26,8 @@ public:
int32_t GetAppSwitchStatus(const std::string &bundleName, const int32_t userId, bool &switchStatus) override;
int32_t ResolveNotificationEvent(const int32_t userId,
const std::string &extraData,
std::string &appBundleName) override;
std::string &appBundleName,
std::string &prepareTraceId) override;
std::shared_ptr<DataSyncManager> GetDataSyncManager() override;
std::shared_ptr<CloudAssetsDownloader> GetCloudAssetsDownloader(const int32_t userId,

View File

@ -24,7 +24,8 @@ public:
virtual int32_t TriggerStartSync(const std::string &bundleName,
const int32_t userId,
bool forceFlag,
SyncTriggerType triggerType);
SyncTriggerType triggerType,
std::string prepareTraceId = "");
};
} // namespace OHOS::FileManagement::CloudFile

View File

@ -47,7 +47,8 @@ int32_t CloudFileKitImpl::GetAppSwitchStatus(const std::string &bundleName,
int32_t CloudFileKitImpl::ResolveNotificationEvent(const int32_t userId,
const std::string &extraData,
std::string &appBundleName)
std::string &appBundleName,
std::string &prepareTraceId)
{
appBundleName = "com.ohos.photos";
return E_OK;

View File

@ -21,7 +21,8 @@ using namespace std;
int32_t DataSyncManagerImpl::TriggerStartSync(const std::string &bundleName,
const int32_t userId,
bool forceFlag,
SyncTriggerType triggerType)
SyncTriggerType triggerType,
std::string prepareTraceId)
{
return E_OK;
}

View File

@ -47,7 +47,8 @@ int32_t CloudFileKit::GetAppSwitchStatus(const std::string &bundleName, const in
int32_t CloudFileKit::ResolveNotificationEvent(const int32_t userId,
const std::string &extraData,
std::string &appBundleName)
std::string &appBundleName,
std::string &prepareTraceId)
{
appBundleName = "com.ohos.photos";
return E_OK;

View File

@ -22,7 +22,8 @@ using namespace std;
int32_t DataSyncManager::TriggerStartSync(const std::string &bundleName,
const int32_t userId,
bool forceFlag,
SyncTriggerType triggerType)
SyncTriggerType triggerType,
std::string prepareTraceId)
{
return E_OK;
}

View File

@ -37,7 +37,8 @@ public:
virtual int32_t GetAppSwitchStatus(const std::string &bundleName, const int32_t userId, bool &switchStatus);
virtual int32_t ResolveNotificationEvent(const int32_t userId,
const std::string &extraData,
std::string &appBundleName);
std::string &appBundleName,
std::string &prepareTraceId);
virtual int32_t GetAppConfigParams(const int32_t userId,
const std::string &bundleName,
std::map<std::string, std::string> &param);

View File

@ -31,7 +31,8 @@ public:
virtual int32_t TriggerStartSync(const std::string &bundleName,
const int32_t userId,
bool forceFlag,
SyncTriggerType triggerType);
SyncTriggerType triggerType,
std::string prepareTraceId = "");
virtual int32_t TriggerStopSync(const std::string &bundleName, const int32_t userId,
bool forceFlag, SyncTriggerType triggerType);
virtual int32_t TriggerRecoverySync(SyncTriggerType triggerType);

View File

@ -438,13 +438,15 @@ int32_t CloudSyncService::NotifyEventChange(int32_t userId, const std::string &e
}
string appBundleName;
auto ret = instance->ResolveNotificationEvent(userId, extraData, appBundleName);
string prepareTraceId;
auto ret = instance->ResolveNotificationEvent(userId, extraData, appBundleName, prepareTraceId);
if (ret != E_OK) {
LOGE("ResolveNotificationEvent failed, ret:%{public}d", ret);
return E_CLOUD_SDK;
}
return dataSyncManager_->TriggerStartSync(appBundleName, userId, false, SyncTriggerType::CLOUD_TRIGGER);
return dataSyncManager_->TriggerStartSync(appBundleName, userId, false,
SyncTriggerType::CLOUD_TRIGGER, prepareTraceId);
}
int32_t CloudSyncService::DisableCloud(const std::string &accoutId)