编译Faban的一些问题

1.修改common,driver,harness中的build-defaults.properties文件,将junit.jar修改到正确的路径。compiler.target.version=1.7

2.修改其中的build.xml文件,将JDK_HOME改为JAVA_HOME.

3.进入common文件夹,执行ant,即 /common$ ant fabancommon.jar

对driver执行ant时,需要将所有需要到的htmlunit的包,放入driver/lib下面,然后执行ant fabandriver.jar

4.需要faban源文件中的stage,sample文件夹才能build成功,即直接在src下面,运行ant build。

5.编译之后的faban代替原来的faban,部署workload之后运行,出现Could not connect to CmdAgent,与workload无关,是faban编译之后的不能使用。

6.~/NetBeansProject/FabanGithub/faban文件夹存储的是最少修改的faban,用来编译build,只需要改动最少的文件,以防干扰。

######### cd ~/NetBeansProject/FabanGithub/faban

######### ant build

######### /opt/faban/master/bin/startup.sh

7.com.sun.faban.harness.agent.AgentBootstrap startAgents中,String shortHost = host.substring(0, dotIdx); 这一句没有判断dotIdx是否是大于0,导致indexOutOfBound,出错,没有在ubuntu上开启agents。实际运行时dotIdx=-1,会抛出异常。在这之前加上判断方法即可。就可以startAgent了。

8. com.sun.faban.harness.agent.AgentBootstrap startAgents中的参数args= args:ubuntu,ubuntu,127.0.1.1,/usr/jdk1.7.0_21,-Dfaban.home=/opt/faban/,-Djava.security.policy=/opt/faban/config/faban.policy,-Djava.util.logging.config.file=/opt/faban/config/logging.properties,-Dfaban.registry.port=9998,-Dfaban.logging.port=9999,-Xmx256m,-Xms64m,

-XX:+DisableExplicitGC,faban.benchmarkName=sampleweb,

9.加入ExtendedJSTransport后,需要把所有的htmlunit的包包括进去。

10.java.lang.NoClassDefFoundError: com/gargoylesoftware/htmlunit/WebClient。这个问题,虽然build的时候可以找到lib文件夹下面的jar包,但是build之后不会把jar包放进去。

在stage/build.xml文件中定义了把那些包包括进去,可以将htmlunit包括进去。

11. com.sun.faban.driver.FatalException: SampleWebAgent[0].0.doHomePage: Transport incomplete! Please ensure transport exception is thrown from operation. 显示driver.engine.AgentThread中validateTimeCompletion方法没有通过验证,抛出异常。查看代码,发现

timingInfo.respondTime == TIME_NOT_SET&& timingInfo.lastRespondTime == TIME_NOT_SET,

那就是respondTime没有设置,那就修改了ExtendedJSTransport中记录时间的代码,并添加了log。

12. 出现We currently only support a single host/port with this workload,这个解决方案是重新部署workload,并不是程序出现问题。

13. 问题是:scale=10,那么开了10个thread,只发了10次请求,应该在steady状态下都发请求。但是目前是rampup状态下,这10次请求就完成了,导致steady状态下没有请求,于是搜集结果时,没有请求。PrintSummary中的txName应该就是operation,这里是三个,会记录每个operation平均响应时间和最大的相应时间。AgentThread中getInvokeTime,根据cycleTime是thinkTime还是CYCLETIME来判断如何设置invokeTime.TimeThreadWithBackground这里的doRun()方法调用AgentThread中的getInvokeTime来设置Drivercontext中的intendedInvoketime. 在DriverContext的recordStartTime中,有设置intendedInvokeTime的方法,那么在recordInvokeTime中也应该按照相似的代码来设置,这样在一段时间之后可以唤起thread。

13.1.AgentThread中根据RunInfo的driverConfig来决定是使用TimeThreadWithBackground,TimeThread还是CycleThread。这里sampleweb使用TimeThread。

14.sampleweb这个workload无法访问www.baidu.com,不知道为什么,就说是cmdservice无法开启。使用corehttp这个workload就可以。

15. Metrix中加入JSTimeInfo用来存储所有的response的时间信息,用map来存储,得到每一类response的信息,输出,最后用画图工具把结果画出来即可。

 16. master和agents之间通信可以使用RMI,那么有没有可能把variloadfile在master和agents之间传递呢?不过这个优先级比较低,而且做之前先把之前的工程保存一份。

17. 150那台是虚拟机的服务器,agent1可以用faban登录,可是master那台机器不可以呢?

18. 在ExtendedTransport文件中添加fetchURLWithJS(String url, WebClient webClient) 方法和 getCredentialWebClient(String url, Map<String, String> credential) 方法。提供form名,submit按钮名,用户名input,passwordInput,登录用户名和密码,获得验证的Webclient,提供给后续的获得url操作使用。

19.登录的时间应该还是要算上的,不然实际登录时间很少,也不太现实。

20.收集的信息,cpu利用率,响应时间,吞吐量等。

21.修改workload的build,配置agent及registry信息

猜你喜欢

转载自summerli.iteye.com/blog/1911905