Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbailey committed Nov 4, 2019
1 parent d4d9543 commit 52df108
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion command/agent/monitor/monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ TEST:
select {
case <-passed:
break TEST
case <-time.After(2 * time.Second):
case <-time.After(3 * time.Second):
require.Fail(t, "expected to see warn dropped messages")
}
}
Expand Down
7 changes: 3 additions & 4 deletions command/agent_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ func (c *MonitorCommand) Help() string {
helpText := `
Usage: nomad monitor [options]
Shows recent log messages of a nomad agent, and attaches to the agent,
outputting log messagse as they occur in real time. The monitor lets you
Stream log messages of a nomad agent. The monitor command lets you
listen for log levels that may be filtered out of the Nomad agent. For
example your agent may only be logging at INFO level, but with the monitor
command you can set -log-level DEBUG
Expand All @@ -47,7 +46,7 @@ Monitor Specific Options:
}

func (c *MonitorCommand) Synopsis() string {
return "stream logs from a nomad agent"
return "stream logs from a Nomad agent"
}

func (c *MonitorCommand) Name() string { return "monitor" }
Expand All @@ -68,7 +67,7 @@ func (c *MonitorCommand) Run(args []string) int {
flags.Usage = func() { c.Ui.Output(c.Help()) }
flags.StringVar(&logLevel, "log-level", "", "")
flags.StringVar(&nodeID, "node-id", "", "")
flags.BoolVar(&logJSON, "log-json", false, "")
flags.BoolVar(&logJSON, "json", false, "")

if err := flags.Parse(args); err != nil {
return 1
Expand Down
3 changes: 1 addition & 2 deletions nomad/client_agent_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (m *Agent) monitor(conn io.ReadWriteCloser) {
return
}

// Check node read permissions
// Check agent read permissions
if aclObj, err := m.srv.ResolveToken(args.AuthToken); err != nil {
handleStreamResultError(err, nil, encoder)
return
Expand Down Expand Up @@ -146,7 +146,6 @@ func (m *Agent) monitor(conn io.ReadWriteCloser) {
var buf bytes.Buffer
frameCodec := codec.NewEncoder(&buf, structs.JsonHandle)

// framer := sframer.NewStreamFramer(frames, 1*time.Second, 200*time.Millisecond, 64*1024)
framer := sframer.NewStreamFramer(frames, 1*time.Second, 200*time.Millisecond, 1024)
framer.Run()
defer framer.Destroy()
Expand Down

0 comments on commit 52df108

Please sign in to comment.