@@ -24,8 +24,8 @@ public class ASTFProfile {
2424 private List <ASTFTemplate > astfTemplateList ;
2525 private List <ASTFCapInfo > astfCapInfoList ;
2626
27- private Map <String , Integer > tgName2TgId = new LinkedHashMap <>(); // template group name ->
28- // template group id
27+ private Map <String , Integer > tgName2TgId =
28+ new LinkedHashMap <>(); // template group name -> template group id
2929
3030 /**
3131 * construct
@@ -46,15 +46,19 @@ public ASTFProfile(ASTFIpGen defaultIpGen, List<ASTFTemplate> astfTemplateList)
4646 * @param astfTemplateList
4747 * @param astfCapInfoList
4848 */
49- public ASTFProfile (ASTFIpGen defaultIpGen , ASTFGlobalInfo astfClientGlobalInfo ,
50- ASTFGlobalInfo astfServerGlobalInfo , List <ASTFTemplate > astfTemplateList ,
49+ public ASTFProfile (
50+ ASTFIpGen defaultIpGen ,
51+ ASTFGlobalInfo astfClientGlobalInfo ,
52+ ASTFGlobalInfo astfServerGlobalInfo ,
53+ List <ASTFTemplate > astfTemplateList ,
5154 List <ASTFCapInfo > astfCapInfoList ) {
5255 this .astfClientGlobalInfo = astfClientGlobalInfo ;
5356 this .astfServerGlobalInfo = astfServerGlobalInfo ;
5457
5558 if (astfTemplateList == null && astfCapInfoList == null ) {
56- throw new IllegalStateException (String .format (
57- "bad param combination,AstfTemplate and AstfCapInfo should not be null at the same time " ));
59+ throw new IllegalStateException (
60+ String .format (
61+ "bad param combination,AstfTemplate and AstfCapInfo should not be null at the same time " ));
5862 }
5963 this .astfTemplateList = astfTemplateList ;
6064 this .astfCapInfoList = astfCapInfoList ;
@@ -117,8 +121,9 @@ public ASTFProfile(ASTFIpGen defaultIpGen, ASTFGlobalInfo astfClientGlobalInfo,
117121 } else {
118122 dPort = capInfo .getAssoc ().getPort ();
119123 myAssoc = capInfo .getAssoc ();
120- throw new IllegalStateException (String .format (
121- "More than one cap use dest port %s. This is currently not supported." , dPort ));
124+ throw new IllegalStateException (
125+ String .format (
126+ "More than one cap use dest port %s. This is currently not supported." , dPort ));
122127 }
123128 dPorts .add (dPort );
124129
@@ -150,11 +155,20 @@ public ASTFProfile(ASTFIpGen defaultIpGen, ASTFGlobalInfo astfClientGlobalInfo,
150155 }
151156
152157 for (Map <String , Object > map : allCapInfo ) {
153- ASTFTCPClientTemplate tempC = new ASTFTCPClientTemplate ((ASTFProgram ) map .get ("prog_c" ),
154- (ASTFIpGen ) map .get ("ip_gen" ), null , (int ) map .get ("d_port" ), (float ) map .get ("cps" ),
155- (ASTFGlobalInfoPerTemplate ) map .get ("glob_c" ), (int ) map .get ("limit" ));
156- ASTFTCPServerTemplate tempS = new ASTFTCPServerTemplate ((ASTFProgram ) map .get ("prog_s" ),
157- (ASTFAssociation ) map .get ("my_assoc" ), (ASTFGlobalInfoPerTemplate ) map .get ("glob_s" ));
158+ ASTFTCPClientTemplate tempC =
159+ new ASTFTCPClientTemplate (
160+ (ASTFProgram ) map .get ("prog_c" ),
161+ (ASTFIpGen ) map .get ("ip_gen" ),
162+ null ,
163+ (int ) map .get ("d_port" ),
164+ (float ) map .get ("cps" ),
165+ (ASTFGlobalInfoPerTemplate ) map .get ("glob_c" ),
166+ (int ) map .get ("limit" ));
167+ ASTFTCPServerTemplate tempS =
168+ new ASTFTCPServerTemplate (
169+ (ASTFProgram ) map .get ("prog_s" ),
170+ (ASTFAssociation ) map .get ("my_assoc" ),
171+ (ASTFGlobalInfoPerTemplate ) map .get ("glob_s" ));
158172 ASTFTemplate template = new ASTFTemplate (tempC , tempS );
159173 astfTemplateList .add (template );
160174 }
@@ -211,8 +225,9 @@ public void printStats() {
211225 tempJson .getAsJsonObject ("client_template" ).get ("program_index" ).getAsInt ();
212226 int serverProgInd =
213227 tempJson .getAsJsonObject ("server_template" ).get ("program_index" ).getAsInt ();
214- int totalBytes = ASTFTemplateBase .getTotalSendBytes (clientProgInd )
215- + ASTFTemplateBase .getTotalSendBytes (serverProgInd );
228+ int totalBytes =
229+ ASTFTemplateBase .getTotalSendBytes (clientProgInd )
230+ + ASTFTemplateBase .getTotalSendBytes (serverProgInd );
216231
217232 float tempCps = tempJson .getAsJsonObject ("client_template" ).get ("cps" ).getAsFloat ();
218233 float tempBps = totalBytes * tempCps * 8 ;
0 commit comments