From 0a94c62ca46d4614fc08e2af54d63c7d28eab293 Mon Sep 17 00:00:00 2001 From: Drew Bailey <2614075+drewbailey@users.noreply.github.com> Date: Mon, 31 Aug 2020 14:13:03 -0400 Subject: [PATCH] run commands for duration and interval without needing to specify servers or nodes --- command/operator_debug.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/command/operator_debug.go b/command/operator_debug.go index ef105a0ceda9..d8260f560de2 100644 --- a/command/operator_debug.go +++ b/command/operator_debug.go @@ -267,10 +267,8 @@ func (c *OperatorDebugCommand) Run(args []string) int { c.Ui.Output("Starting debugger and capturing cluster data...") - if len(c.nodeIDs) > 0 || len(c.serverIDs) > 0 { - c.Ui.Output(fmt.Sprintf(" Interval: '%s'", interval)) - c.Ui.Output(fmt.Sprintf(" Duration: '%s'", duration)) - } + c.Ui.Output(fmt.Sprintf(" Interval: '%s'", interval)) + c.Ui.Output(fmt.Sprintf(" Duration: '%s'", duration)) // Create the output path var tmp string @@ -505,13 +503,6 @@ func (c *OperatorDebugCommand) collectPprof(path, id string, client *api.Client) // collectPeriodic runs for duration, capturing the cluster state every interval. It flushes and stops // the monitor requests func (c *OperatorDebugCommand) collectPeriodic(client *api.Client) { - // Not monitoring any logs, just capture the nomad context before exit - if len(c.nodeIDs) == 0 && len(c.serverIDs) == 0 { - dir := filepath.Join("nomad", "0000") - c.collectNomad(dir, client) - return - } - duration := time.After(c.duration) // Set interval to 0 so that we immediately execute, wait the interval next time interval := time.After(0 * time.Second)