fix: resolve conflicts

This commit is contained in:
徐聪
2024-08-14 11:09:08 +08:00
parent 42f68e0641
commit 0c2244c5bc
8 changed files with 33 additions and 52 deletions

View File

@@ -62,9 +62,12 @@ type ScreenResult struct {
Video *Video `json:"video,omitempty"`
Popup *PopupInfo `json:"popup,omitempty"`
SwipeStartTime int64 `json:"swipe_start_time"` // 滑动开始时间戳
SwipeFinishTime int64 `json:"swipe_finish_time"` // 滑动结束时间戳
SwipeStartTime int64 `json:"swipe_start_time"` // 滑动开始时间戳
SwipeFinishTime int64 `json:"swipe_finish_time"` // 滑动结束时间戳
FetchVideoStartTime int64 `json:"fetch_video_start_time"` // 抓取视频开始时间戳
FetchVideoFinishTime int64 `json:"fetch_video_finish_time"` // 抓取视频结束时间戳
FetchVideoElapsed int64 `json:"fetch_video_elapsed"` // 抓取视频耗时(ms)
ScreenshotTakeElapsed int64 `json:"screenshot_take_elapsed"` // 设备截图耗时(ms)
ScreenshotCVElapsed int64 `json:"screenshot_cv_elapsed"` // CV 识别耗时(ms)

View File

@@ -212,7 +212,7 @@ func (dExt *DriverExt) swipeToTapApp(appName string, options ...ActionOption) er
}
// automatic handling popups before swipe
if err := dExt.ClosePopups(); err != nil {
if err := dExt.ClosePopupsHandler(); err != nil {
log.Error().Err(err).Msg("auto handle popup failed")
}

View File

@@ -184,6 +184,7 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
// get app event trackings
// retry 3 times if get feed failed, abort if fail 3 consecutive times
fetchVideoStartTime := time.Now()
currentVideo, err := crawler.getCurrentVideo()
if err != nil || currentVideo.Type == "" {
crawler.failedCount++
@@ -204,6 +205,7 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
// retry
continue
}
fetchVideoFinishTime := time.Now()
// 直播预览流线上概率
livePreviewProb := crawler.getLivePreviewProb()
@@ -278,6 +280,9 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
screenResult.SwipeStartTime = swipeStartTime.UnixMilli()
screenResult.SwipeFinishTime = swipeFinishTime.UnixMilli()
screenResult.TotalElapsed = time.Since(swipeFinishTime).Milliseconds()
screenResult.FetchVideoStartTime = fetchVideoStartTime.UnixMilli()
screenResult.FetchVideoFinishTime = fetchVideoFinishTime.UnixMilli()
screenResult.FetchVideoElapsed = fetchVideoFinishTime.Sub(fetchVideoStartTime).Milliseconds()
var exitLive bool
if crawler.isLiveTargetAchieved() {
@@ -313,8 +318,11 @@ func (dExt *DriverExt) VideoCrawler(configs *VideoCrawlerConfigs) (err error) {
Video: currentVideo,
// log swipe timelines
SwipeStartTime: swipeStartTime.UnixMilli(),
SwipeFinishTime: swipeFinishTime.UnixMilli(),
SwipeStartTime: swipeStartTime.UnixMilli(),
SwipeFinishTime: swipeFinishTime.UnixMilli(),
FetchVideoStartTime: fetchVideoStartTime.UnixMilli(),
FetchVideoFinishTime: fetchVideoFinishTime.UnixMilli(),
FetchVideoElapsed: fetchVideoFinishTime.Sub(fetchVideoStartTime).Milliseconds(),
}
dExt.cacheStepData.screenResults[time.Now().String()] = screenResult