-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): add
overview
subcommand to overview the dependencies lik…
…e mysql/redis/ in one cmd line
- Loading branch information
Showing
7 changed files
with
119 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package cmd | ||
|
||
import "github.com/spf13/cobra" | ||
|
||
var overviewCmd = &cobra.Command{ | ||
Use: "overview [--metrics <metric_name>]", | ||
Short: "Overview the dependencies like mysql/redis/.. in one cmd line.", | ||
Example: ` | ||
# Basic Usage | ||
sudo kyanos overview | ||
`, | ||
PersistentPreRun: func(cmd *cobra.Command, args []string) { Mode = AnalysisMode }, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
overview = true | ||
groupBy = "remote-ip/protocol-adaptive" | ||
startAgent() | ||
}, | ||
} | ||
|
||
var overview bool | ||
|
||
func init() { | ||
overviewCmd.PersistentFlags().StringVarP(&enabledMetricsString, "metrics", "m", "t", `Specify the statistical dimensions, including: | ||
t: total time taken for request response, | ||
q: request size, | ||
p: response size, | ||
n: network device latency, | ||
s: time spent reading from the socket buffer`) | ||
|
||
overviewCmd.Flags().SortFlags = false | ||
overviewCmd.PersistentFlags().SortFlags = false | ||
rootCmd.AddCommand(overviewCmd) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters