mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
change: replace log duration in miliseconds
This commit is contained in:
@@ -273,7 +273,7 @@ func (d *Device) RunShellCommandWithBytes(cmd string, args ...string) ([]byte, e
|
|||||||
// log elapsed seconds for shell execution
|
// log elapsed seconds for shell execution
|
||||||
log.Debug().Str("cmd",
|
log.Debug().Str("cmd",
|
||||||
fmt.Sprintf("adb -s %s shell %s", d.serial, cmd)).
|
fmt.Sprintf("adb -s %s shell %s", d.serial, cmd)).
|
||||||
Float64("elapsed(s)", time.Since(startTime).Seconds()).
|
Int64("elapsed(ms)", time.Since(startTime).Milliseconds()).
|
||||||
Msg("run adb shell")
|
Msg("run adb shell")
|
||||||
}()
|
}()
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ func (d *Device) RunShellCommandV2WithBytes(cmd string, args ...string) ([]byte,
|
|||||||
// log elapsed seconds for shell execution
|
// log elapsed seconds for shell execution
|
||||||
log.Debug().Str("cmd",
|
log.Debug().Str("cmd",
|
||||||
fmt.Sprintf("adb -s %s shell %s", d.serial, cmd)).
|
fmt.Sprintf("adb -s %s shell %s", d.serial, cmd)).
|
||||||
Float64("elapsed(s)", time.Since(startTime).Seconds()).
|
Int64("elapsed(ms)", time.Since(startTime).Milliseconds()).
|
||||||
Msg("run adb shell in v2")
|
Msg("run adb shell in v2")
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ func (dExt *DriverExt) DoAction(action MobileAction) error {
|
|||||||
log.Debug().
|
log.Debug().
|
||||||
Str("method", string(action.Method)).
|
Str("method", string(action.Method)).
|
||||||
Interface("params", action.Params).
|
Interface("params", action.Params).
|
||||||
Float64("elapsed(s)", time.Since(actionStartTime).Seconds()).
|
Int64("elapsed(ms)", time.Since(actionStartTime).Milliseconds()).
|
||||||
Msg("uixt action end")
|
Msg("uixt action end")
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ func (s *veDEMImageService) GetImage(imageBuf *bytes.Buffer, options ...interfac
|
|||||||
log.Debug().
|
log.Debug().
|
||||||
Str("X-TT-LOGID", logID).
|
Str("X-TT-LOGID", logID).
|
||||||
Int("image_bytes", size).
|
Int("image_bytes", size).
|
||||||
Float64("elapsed(s)", elapsed.Seconds()).
|
Int64("elapsed(ms)", elapsed.Milliseconds()).
|
||||||
Msg("request OCR service success")
|
Msg("request OCR service success")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -379,8 +379,8 @@ func (dExt *DriverExt) GetScreenResult() (screenResult *ScreenResult, err error)
|
|||||||
dExt.cacheStepData.screenResults[imagePath] = screenResult
|
dExt.cacheStepData.screenResults[imagePath] = screenResult
|
||||||
|
|
||||||
log.Debug().
|
log.Debug().
|
||||||
Int64("ScreenshotTakeElapsed", screenResult.ScreenshotTakeElapsed).
|
Int64("screenshot_take_elapsed(ms)", screenResult.ScreenshotTakeElapsed).
|
||||||
Int64("ScreenshotCVElapsed", screenResult.ScreenshotCVElapsed).
|
Int64("screenshot_cv_elapsed(ms)", screenResult.ScreenshotCVElapsed).
|
||||||
Msg("get screenshot result success")
|
Msg("get screenshot result success")
|
||||||
return screenResult, nil
|
return screenResult, nil
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -586,12 +586,12 @@ func (r *SessionRunner) Start(givenVars map[string]interface{}) error {
|
|||||||
r.sessionVariables[k] = v
|
r.sessionVariables[k] = v
|
||||||
}
|
}
|
||||||
|
|
||||||
stepElapsed := time.Since(stepStartTime).Seconds()
|
stepElapsed := time.Since(stepStartTime).Milliseconds()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Info().Str("step", stepName).
|
log.Info().Str("step", stepName).
|
||||||
Str("type", stepType).
|
Str("type", stepType).
|
||||||
Bool("success", true).
|
Bool("success", true).
|
||||||
Float64("elapsed(s)", stepElapsed).
|
Int64("elapsed(ms)", stepElapsed).
|
||||||
Interface("exportVars", stepResult.ExportVars).
|
Interface("exportVars", stepResult.ExportVars).
|
||||||
Msg("run step end")
|
Msg("run step end")
|
||||||
continue
|
continue
|
||||||
@@ -601,7 +601,7 @@ func (r *SessionRunner) Start(givenVars map[string]interface{}) error {
|
|||||||
log.Error().Err(err).Str("step", stepName).
|
log.Error().Err(err).Str("step", stepName).
|
||||||
Str("type", stepType).
|
Str("type", stepType).
|
||||||
Bool("success", false).
|
Bool("success", false).
|
||||||
Float64("elapsed(s)", stepElapsed).
|
Int64("elapsed(ms)", stepElapsed).
|
||||||
Msg("run step end")
|
Msg("run step end")
|
||||||
|
|
||||||
// interrupted or timeout, abort running
|
// interrupted or timeout, abort running
|
||||||
|
|||||||
Reference in New Issue
Block a user