From 1b798576e6b5a66a0f8596cf4a9a244c3798ad24 Mon Sep 17 00:00:00 2001 From: tukeJonny Date: Fri, 24 Nov 2023 18:29:20 +0900 Subject: [PATCH] =?UTF-8?q?=E9=95=B7=E6=99=82=E9=96=93=E9=85=8D=E4=BF=A1?= =?UTF-8?q?=E6=9E=A0=E8=BF=BD=E5=8A=A0=20(#395)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bench/scenario/streamer.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/bench/scenario/streamer.go b/bench/scenario/streamer.go index f9871824e..3abb951da 100644 --- a/bench/scenario/streamer.go +++ b/bench/scenario/streamer.go @@ -54,10 +54,21 @@ func BasicStreamerColdReserveScenario( } } - reservation, err := scheduler.ReservationSched.GetColdShortReservation() - if err != nil { - lgr.Warnf("reserve: failed to get cold short reservation: %s\n", err.Error()) - return err + var reservation *scheduler.Reservation + if n%2 == 0 { + r, err := scheduler.ReservationSched.GetColdShortReservation() + if err != nil { + lgr.Warnf("reserve: failed to get cold short reservation: %s\n", err.Error()) + return err + } + reservation = r + } else { + r, err := scheduler.ReservationSched.GetColdLongReservation() + if err != nil { + lgr.Warnf("reserve: failed to get cold long reservation: %s\n", err.Error()) + return err + } + reservation = r } tags, err := client.GetRandomLivestreamTags(ctx, 5)