Skip to content

Commit

Permalink
Merge pull request #403 from isucon/bench-reduce-log
Browse files Browse the repository at this point in the history
reduce logs
  • Loading branch information
kazeburo authored Nov 24, 2023
2 parents df43a2e + 5aeb08e commit c0aeb78
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion bench/cmd/bench/benchmarker.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ loop:
break loop
}
}
b.contestantLogger.Info("DNS水責め負荷が上昇します ///")
}

func (b *benchmarker) loadStreamer(ctx context.Context) error {
Expand Down
3 changes: 2 additions & 1 deletion bench/scenario/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ func BasicStreamerColdReserveScenario(
scheduler.ReservationSched.CommitReservation(reservation)

livestreamPool.Put(ctx, livestream)
contestantLogger.Info("配信を予約しました", zap.String("streamer", livestream.Owner.Name), zap.String("title", livestream.Title), zap.Int("duration_hours", livestream.Hours()))
// ログ削減
// contestantLogger.Info("配信を予約しました", zap.String("streamer", livestream.Owner.Name), zap.String("title", livestream.Title), zap.Int("duration_hours", livestream.Hours()))

return nil
}
Expand Down
9 changes: 6 additions & 3 deletions bench/scenario/viewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ func BasicViewerScenario(

// NOTE: 配信者のプロフィールが気になる人が一定数いる
if n%10 == 0 {
contestantLogger.Info("視聴者が配信者のプロフィールに関心を持ち、訪問しようとしています", zap.String("viewer", username), zap.String("streamer", livestream.Owner.Name))
// ログ削減
// contestantLogger.Info("視聴者が配信者のプロフィールに関心を持ち、訪問しようとしています", zap.String("viewer", username), zap.String("streamer", livestream.Owner.Name))
lgr.Info("visit user profile")
if err := VisitUserProfile(ctx, contestantLogger, client, &livestream.Owner); err != nil && !errors.Is(err, bencherror.ErrTimeout) {
lgr.Warnf("view: failed to visit user profile: %s\n", err.Error())
Expand All @@ -87,7 +88,8 @@ func BasicViewerScenario(
}
}

contestantLogger.Info("視聴を開始しました", zap.String("username", username), zap.Int("duration_hours", livestream.Hours()))
// ログ削減
// contestantLogger.Info("視聴を開始しました", zap.String("username", username), zap.Int("duration_hours", livestream.Hours()))
for hour := 1; hour <= livestream.Hours(); hour++ {
if comments, err := client.GetLivecomments(ctx, livestream.ID, livestream.Owner.Name); err != nil && !errors.Is(err, bencherror.ErrTimeout) {
lgr.Warnf("view: failed to get livecomments: %s\n", err.Error())
Expand Down Expand Up @@ -127,7 +129,8 @@ func BasicViewerScenario(
continue
}
}
contestantLogger.Info("視聴者が配信を最後まで視聴できました", zap.String("username", username), zap.Int("duration_hours", livestream.Hours()))
// ログ削減
// contestantLogger.Info("視聴者が配信を最後まで視聴できました", zap.String("username", username), zap.Int("duration_hours", livestream.Hours()))

if err := LeaveFromLivestream(ctx, contestantLogger, client, livestream); err != nil && !errors.Is(err, bencherror.ErrTimeout) {
lgr.Warnf("view: failed to leave from livestream: %s\n", err.Error())
Expand Down

0 comments on commit c0aeb78

Please sign in to comment.