address feedback

This commit is contained in:
Drew Bailey
2019-11-04 09:04:47 -05:00
parent 8423ccf890
commit 676800f03a
3 changed files with 5 additions and 7 deletions

View File

@@ -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")
}
}

View File

@@ -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
@@ -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" }
@@ -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

View File

@@ -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
@@ -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()