diff --git a/cmd/perfmon.go b/cmd/perfmon.go index 095a771..97cf929 100644 --- a/cmd/perfmon.go +++ b/cmd/perfmon.go @@ -89,7 +89,7 @@ var ( func init() { rootCmd.AddCommand(perfmonCmd) - perfmonCmd.Flags().StringVarP(&serial, "serial", "s", "", "device serial") + perfmonCmd.Flags().StringVarP(&serial, "serial", "s", "", "device serial (default first device)") perfmonCmd.Flags().IntVarP(&pid, "pid", "d", -1, "get PID data") perfmonCmd.Flags().StringVarP(&packageName, "package", "p", "", "app package name") perfmonCmd.Flags().BoolVar(&perfOptions.SystemCPU, "sys-cpu", false, "get system cpu data") @@ -102,7 +102,7 @@ func init() { //perfmonCmd.Flags().BoolVar(&, "proc-network", false, "get process network data") perfmonCmd.Flags().BoolVar(&perfOptions.ProcCPU, "proc-cpu", false, "get process cpu data") perfmonCmd.Flags().BoolVar(&perfOptions.ProcMem, "proc-mem", false, "get process mem data") - perfmonCmd.Flags().IntVarP(&refreshTime, "refresh", "r", 1000, "data refresh time(millisecond)") + perfmonCmd.Flags().IntVarP(&refreshTime, "refresh", "r", 1000, "data refresh time (millisecond)") perfmonCmd.Flags().BoolVarP(&isFormat, "format", "f", false, "convert to JSON string and format") perfmonCmd.Flags().BoolVarP(&isJson, "json", "j", false, "convert to JSON string") } diff --git a/src/perfmonUtil/process.go b/src/perfmonUtil/process.go index d647d2e..5c76a59 100644 --- a/src/perfmonUtil/process.go +++ b/src/perfmonUtil/process.go @@ -376,7 +376,7 @@ func GetProcessInfo(client *adb.Device, pid string, packageName string, perfOpti if processInfo == nil { processInfo = &entity.ProcessInfo{} } - var fps = 0 + fps := 0 fps, err = getProcessFPSBySurfaceFlinger(client, packageName) @@ -466,7 +466,7 @@ func getProcessFPSBySurfaceFlinger(client *adb.Device, pkg string) (result int, break } if activity == "" { - return 0, errors.New(fmt.Sprintf("not find app %s activity", pkg)) + return 0, errors.New(fmt.Sprintf("could not find app %s activity", pkg)) } //var r = strings.NewReplacer("[", "", "") activity = strings.Replace(activity, "[", "", 1)