Scenario manager#121
Conversation
Signed-off-by: Raguideau <akiyaraguideau@gmail.com>
Signed-off-by: Raguideau <akiyaraguideau@gmail.com>
Signed-off-by: Raguideau <akiyaraguideau@gmail.com>
Signed-off-by: Raguideau <akiyaraguideau@gmail.com>
Signed-off-by: Raguideau <akiyaraguideau@gmail.com>
Signed-off-by: Raguideau <akiyaraguideau@gmail.com>
Signed-off-by: Raguideau <akiyaraguideau@gmail.com>
2550afe to
9f9c895
Compare
There was a problem hiding this comment.
Thanks a lot for your PR, it indeed something we need a lot!
One thing that comes to mind, is that by isolating a Scenario per UE, it might be harder to manage things like task rates (eg. Scenario has 10 000 UEs registered, and wants to use some of them to do 100 PDU Session creation per second, so it must be able to dynamically tweak the rate of all UE to reach 100 TX/s).
Could we avoid having an ueTaskExecuter pe UE, bring back the code of the ueTaskExecuter into something like a scenarioExecutor which I guess scenarioManager is kind of, that manages all UEs requests and gNodeBs?
I've offered a few comments on the code with the design as-is. Thanks a lot, it's quite great!
| base := int(gnbId_int) + i | ||
|
|
||
| time.Sleep(time.Second * 1) | ||
| gnbId = fmt.Sprintf("%06x", base) |
| return gnb | ||
| } | ||
|
|
||
| func genereateGnbId(i int, gnbId string) string { |
| log.Info("------------------------------------ Scenario finished ------------------------------------") | ||
| } | ||
|
|
||
| func initManager(ueScenarios []UEScenario, timeBetweenRegistration int, timeout int) *ScenarioManager { |
There was a problem hiding this comment.
please add line breaks to group together similar things in your code, it makes the code a bit more readable :D
ex:
log.Debug("Init manager with timeBetweenRegistration = ", timeBetweenRegistration)
s := &ScenarioManager{}
s.ues = make(map[int]*ueTasksCtx)
s.taskExecuterWg = &sync.WaitGroup{}
s.gnbWg = &sync.WaitGroup{}
s.reportChan = make(chan report, 10)
s.sigStop = make(chan os.Signal, 1)
signal.Notify(s.sigStop, os.Interrupt)
s.registrationQueue = make(chan order, len(ueScenarios))
go startOrderRateController(s.registrationQueue, timeBetweenRegistration)
if timeout > 0 {
time.AfterFunc(time.Duration(timeout)*time.Millisecond, func() {
log.Debug("Scenario Timeout, sending interrupt signal")
s.sigStop <- os.Interrupt
})
}| select { | ||
| case <-s.sigStop: | ||
| s.stop = true | ||
| ueId = len(ueScenarios) + 1 // exit loop |
There was a problem hiding this comment.
smart :D but just return would work
do we actually need this select / check at this step though?
| case report := <-s.reportChan: | ||
| s.handleReport(report) | ||
| if err := s.manageNextTask(report.ueId, s.ueScenarios[report.ueId-1]); err != nil { | ||
| if !s.ueScenarios[report.ueId-1].Hang { |
| } | ||
| } | ||
|
|
||
| func (s *ScenarioManager) cleanup() { |
There was a problem hiding this comment.
you should reorder the functions in this file in the order they are first seen / or when used in the flow of the lifecycle of this file (cleanup should be probably more towards the bottom)
| log.Errorf("[UE-%d] Reported error: %s", report.ueId, report.reason) | ||
| return | ||
| } | ||
| log.Infof("[UE-%d] Reported succes: %s", report.ueId, report.reason) |
There was a problem hiding this comment.
Very cool to finally have the beginnings of reports! :D
| time.Sleep(2 * time.Second) | ||
| } | ||
|
|
||
| func (s *ScenarioManager) setupUeTaskExecuter(ueId int, ueScenario UEScenario) error { |
Signed-off-by: Raguideau <akiyaraguideau@gmail.com>
Signed-off-by: Raguideau <akiyaraguideau@gmail.com>
ceb1dbb to
c3bbed8
Compare
Types of changes
Signed-off-by: Author Name <authoremail@example.com>to accept the DCO.