diff --git a/cmd/perfmon/process.go b/cmd/perfmon/process.go index 7a74164..78ae0f4 100644 --- a/cmd/perfmon/process.go +++ b/cmd/perfmon/process.go @@ -43,7 +43,7 @@ var processPerfmonCmd = &cobra.Command{ } sig := make(chan os.Signal, 1) signal.Notify(sig, os.Interrupt, os.Kill) - timer := time.Tick(time.Duration(interval * int(time.Second))) + timer := time.Tick(time.Duration(interval * int(time.Millisecond))) done := false for !done { select { @@ -71,7 +71,7 @@ func initProcessPerfmon() { processPerfmonCmd.Flags().StringVarP(&appName, "name", "n", "", "application name") processPerfmonCmd.MarkFlagRequired("name") processPerfmonCmd.Flags().StringVarP(&serial, "serial", "s", "", "device serial") - processPerfmonCmd.Flags().IntVarP(&interval, "interval", "i", 1, "data refresh time") + processPerfmonCmd.Flags().IntVarP(&interval, "interval", "i", 1000, "data refresh time") processPerfmonCmd.Flags().BoolVarP(&isJson, "json", "j", false, "convert to JSON string") processPerfmonCmd.Flags().BoolVarP(&isFormat, "format", "f", false, "convert to JSON string and format") } diff --git a/cmd/perfmon/system.go b/cmd/perfmon/system.go index 372d7f8..ccbe43f 100644 --- a/cmd/perfmon/system.go +++ b/cmd/perfmon/system.go @@ -37,7 +37,7 @@ var systemPerfmonCmd = &cobra.Command{ sig := make(chan os.Signal, 1) signal.Notify(sig, os.Interrupt, os.Kill) - timer := time.Tick(time.Duration(interval * int(time.Second))) + timer := time.Tick(time.Duration(interval * int(time.Millisecond))) done := false for !done { select { @@ -56,7 +56,7 @@ var systemPerfmonCmd = &cobra.Command{ func initSystemPerfmon() { perfmonRootCMD.AddCommand(systemPerfmonCmd) systemPerfmonCmd.Flags().StringVarP(&serial, "serial", "s", "", "device serial") - systemPerfmonCmd.Flags().IntVarP(&interval, "interval", "i", 1, "data refresh time") + systemPerfmonCmd.Flags().IntVarP(&interval, "interval", "i", 1000, "data refresh time") systemPerfmonCmd.Flags().BoolVarP(&isJson, "json", "j", false, "convert to JSON string") systemPerfmonCmd.Flags().BoolVarP(&isFormat, "format", "f", false, "convert to JSON string and format") } diff --git a/src/entity/system.go b/src/entity/system.go index 0cda0f8..e326912 100644 --- a/src/entity/system.go +++ b/src/entity/system.go @@ -112,6 +112,7 @@ Memory: escBrightWhite, v.Guest, escReset, ) } + result += "\n" } if len(stats.NetworkInfo) > 0 {