Skip to content

Commit 20fda81

Browse files
authored
Merge pull request #1307 from ripienaar/report_limits
Add response limit argument to all reports
2 parents 051f32e + 54a3e47 commit 20fda81

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/server_report_command.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,18 @@ func configureServerReportCommand(srv *fisk.CmdClause) {
103103
conns.Flag("json", "Produce JSON output").Short('j').UnNegatableBoolVar(&c.json)
104104

105105
cpu := report.Command("cpu", "Report on CPU usage").Action(c.reportCPU)
106+
cpu.Arg("limit", "Limit the responses to a certain amount of servers").IntVar(&c.waitFor)
106107
addFilterOpts(cpu)
107108
cpu.Flag("json", "Produce JSON output").Short('j').UnNegatableBoolVar(&c.json)
108109

109110
gateways := report.Command("gateways", "Repost on Gateway (Super Cluster) connections").Alias("super").Alias("gateway").Action(c.reportGateway)
111+
gateways.Arg("limit", "Limit the responses to a certain amount of servers").IntVar(&c.waitFor)
110112
gateways.Flag("filter-name", "Limits responses to a certain name").StringVar(&c.gatewayName)
111113
gateways.Flag("sort", "Sorts by a specific property (server,cluster)").Default("cluster").EnumVar(&c.sort, "server", "cluster")
112114
addFilterOpts(gateways)
113115

114116
health := report.Command("health", "Report on Server health").Action(c.reportHealth)
117+
health.Arg("limit", "Limit the responses to a certain amount of servers").IntVar(&c.waitFor)
115118
health.Flag("js-enabled", "Checks that JetStream should be enabled on all servers").Short('J').BoolVar(&c.jsEnabled)
116119
health.Flag("server-only", "Restricts the health check to the JetStream server only, do not check streams and consumers").Short('S').BoolVar(&c.jsServerOnly)
117120
health.Flag("account", "Check only a specific Account").StringVar(&c.account)
@@ -127,15 +130,18 @@ func configureServerReportCommand(srv *fisk.CmdClause) {
127130
addFilterOpts(jsz)
128131

129132
leafs := report.Command("leafnodes", "Report on Leafnode connections").Alias("leaf").Alias("leafz").Action(c.reportLeafs)
133+
leafs.Arg("limit", "Limit the responses to a certain amount of servers").IntVar(&c.waitFor)
130134
leafs.Flag("account", "Produce the report for a specific account").StringVar(&c.account)
131135
leafs.Flag("sort", "Sort by a specific property (server,name,account,subs,in-bytes,out-bytes,in-msgs,out-msgs)").EnumVar(&c.sort, "server", "name", "account", "subs", "in-bytes", "out-bytes", "in-msgs", "out-msgs")
132136
addFilterOpts(leafs)
133137

134138
mem := report.Command("mem", "Report on Memory usage").Action(c.reportMem)
139+
mem.Arg("limit", "Limit the responses to a certain amount of servers").IntVar(&c.waitFor)
135140
addFilterOpts(mem)
136141
mem.Flag("json", "Produce JSON output").Short('j').UnNegatableBoolVar(&c.json)
137142

138143
routes := report.Command("routes", "Report on Route (Cluster) connections").Alias("route").Action(c.reportRoute)
144+
routes.Arg("limit", "Limit the responses to a certain amount of servers").IntVar(&c.waitFor)
139145
routes.Flag("sort", "Sort by a specific property (server,cluster,name,account,subs,in-bytes,out-bytes)").EnumVar(&c.sort, "server", "cluster", "name", "account", "subs", "in-bytes", "out-bytes")
140146
addFilterOpts(routes)
141147
}

0 commit comments

Comments
 (0)