Skip to content

Commit

Permalink
ログを200行、末尾から取るように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwara committed Nov 24, 2023
1 parent df43a2e commit 843487b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bench/cmd/bench/supervise.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ func fetchAZName(ctx context.Context) (string, error) {
return azName, nil
}

// messagesの末尾からn行を結合して取得
func joinN(messages []string, n int) string {
if len(messages) > n {
return strings.Join(messages[:n], ",\n")
if len(messages) <= n {
return strings.Join(messages, "\n")
}
return strings.Join(messages, ",\n")
return strings.Join(messages[len(messages)-n:], "\n")
}

func execBench(ctx context.Context, job *Job) (*Result, error) {
Expand Down Expand Up @@ -280,7 +281,7 @@ var supervise = cli.Command{
},
cli.IntFlag{
Name: "message-limit",
Value: 2000,
Value: 200,
Destination: &messageLimit,
EnvVar: "SUPERVISOR_MESSAGE_LIMIT",
},
Expand Down

0 comments on commit 843487b

Please sign in to comment.