admin
2025-01-22 7e31442f0e9b07764e9c6a9680d3d4aeba5fe1de
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Quintiq file version 2.0
#parent: #root
Method PTF_ExecuteClient (
  structured[LibPTF_TestScript] testscripts,
  String str
) as String id:Method_LibPTF_pnlTestController_PTF_ExecuteClient
{
  #keys: '[102890.0.1874250332]'
  Body:
  [*
    // Checks the status of the expected clients and launched clients in all the scripts and launch the next batches of clients when the previous batches of clients complete its execution
    
    rowDelimiter    := LibPTF_Util::StringListRowDelimiter();   
    columnDelimiter := LibPTF_Util::StringListColumnDelimiter();
    
    tracker         := construct( Strings );
    rows            := str.Tokenize( rowDelimiter );
    
    traverse( rows, Elements, row )
    {
      columns := row.Tokenize( columnDelimiter );
    
      user                  := columns.Element( 0 );
      reqSessions           := [Number]columns.Element( 1 );
      reqConcurrentSessions := [Number]columns.Element( 2 );
      executedSessions_o    := [Number]columns.Element( 3 );
      executingSessions_o   := [Number]columns.Element( 4 );
      remainingSessions     := [Number]columns.Element( 5 );
      startTime_o           := columns.Element( 6 );
      endTime               := columns.Element( 7 );
      // elapsedtime        := columns.Element( 8 ); Not being used
      startoffset           := columns.Element( 9 );
    
      remainingConcurrentSessions := reqConcurrentSessions - executingSessions_o;
      script                      := select( testscripts,
                                             Elements,
                                             s,
                                             true,
                                             s.User() = user );
      
      currentTime := this.PTF_ConvertStringToDateTime( this.PTF_GetCurrentDatetime() );
      
      if( remainingSessions > 0
          and this.PTF_ConvertStringToDateTime( lblStartTime.Text() ) + [Duration]startoffset <= currentTime 
        )
      {
        nrOfClientsToStart := minvalue( remainingSessions, remainingConcurrentSessions );
    
        this.PTF_ExecuteClientByScript( script,
                                        nrOfClientsToStart,
                                        executedSessions_o,
                                        executingSessions_o,
                                        startTime_o
                                          );
      }
    
      columns.Flush();
      columns.Add( user );
      columns.Add( [String]reqSessions );
      columns.Add( [String]reqConcurrentSessions );
      columns.Add( [String]executedSessions_o );
      columns.Add( [String]executingSessions_o );
      columns.Add( [String]remainingSessions );
      columns.Add( startTime_o );
      columns.Add( endTime );
      columns.Add( this.PTF_GetTotalDuration( startTime_o, endTime ) );
      columns.Add( startoffset );
    
      tracker.Add( columns.ToString( columnDelimiter ) );
    }
    
    return tracker.ToString( rowDelimiter );
  *]
}