Skip to content

Commit

Permalink
Merge pull request #404 from isucon/fix/truncate-msg
Browse files Browse the repository at this point in the history
ベンチのログを切り詰め + 不要ログ削除
  • Loading branch information
kazeburo authored Nov 24, 2023
2 parents c0aeb78 + f735834 commit 57c335d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion bench/cmd/bench/benchmarker.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ func powWeightSize(m int) int64 {

func newBenchmarker(ctx context.Context, contestantLogger *zap.Logger) *benchmarker {
var weight int64 = int64(config.BaseParallelism)
contestantLogger.Info("負荷レベル", zap.Int64("level", weight))
// いま負荷レベルは固定値なので選手に見せる意味がない
// contestantLogger.Info("負荷レベル", zap.Int64("level", weight))

longStreamerClientPool := isupipe.NewClientPool(ctx)
streamerClientPool := isupipe.NewClientPool(ctx)
Expand Down
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 57c335d

Please sign in to comment.