Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aoliaoaoaojiao committed Jan 11, 2023
2 parents 5e71e38 + bad2147 commit 478508d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/perfmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
}
4 changes: 2 additions & 2 deletions src/perfmonUtil/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 478508d

Please sign in to comment.