Wednesday, August 07, 2013

How to do a multipart file upload in ruby

gem install httpclient

 require 'httpclient'  
 require 'uri'  
 # Do multipart file upload with POST  
  httpreq = HTTPClient.new  
  File.open("#{filename}") do |file|  
   body = { 'year' => "#{curyear}", 'tag' => "#{tagname}", 'uploadfile' => file}  
   res = httpreq.post(URI("#{uri}"), body)  
  end  

Wednesday, July 31, 2013

ActiveMQ Jmeter Test Plan on my github

Recently, i am testing the our message queue capacity and performance which is ActiveMQ...So i made a sample Jmeter test plan on my github, once someone want take a reference:

https://github.com/joychester/ActiveMQJMeterTestPlan

This reminds me one of my report issue to JMeter JMS Sampler 3 years ago :) Time flies!!
https://issues.apache.org/bugzilla/show_bug.cgi?id=49111

Wednesday, May 01, 2013

"PetGym" is on my github now -- Automated your Jmeter tests

Jmeter PluginCMD provide a capability for running jmeter tests automatically with many cool reports generated: http://code.google.com/p/jmeter-plugins/wiki/JMeterPluginsCMD

I am writing a ruby program to meet my basic requirement during my performance tests.
Please check it out if you want to give it a try: https://github.com/joychester/PetGym

Thursday, April 18, 2013

FastMole is on my GitHub now!

FastMole which is one of my project to do Continuous Page performance tests is on my github now: https://github.com/joychester/FastMole

Tuesday, April 09, 2013

My New Life, My Baby Girl!!

My lovely baby girl comes into my life for 2 weeks!! My life is going to be changed from now on :-)

Generate Load by adding reasonable think time

I used to generate load by launching small number of VUs without any think time during performance testing. The pros is You can trigger a very high load/Throughput even you are not creating many concurrent threads, but the cons is you can not generate consistent/stable load to make comparison once you make some tuning or changes. Recently, I am discussing with my teammate ZhouZhou, and figure out how we generate a consistent load by adding reasonable think time(Little Law helps the calculation here) between each request, here is the diagram we made to show how much load/Throughput we can generate/get:

Thursday, August 30, 2012

Monitoring your load generator client, when the server CPU% is under utilized

Recently, I am using one Virtual Box(VMware/2 Cores / 8GB) to conduct performance/load testing. With more and more load Jmeter generate, It seems the server's CPU% is not able to go up...
However, I noticed the my vitual-box client's CPU% has reached to 90%+. After changing to a physical and more powerful machine, everything is fine, server side CPU% can go up with increasing payload. I am not often to monitoring load generator client during my testing previously, and they are usually works fine as its physical machine.
You have to monitor your load generator machine as well when you find the server CPU% is under utilized(stay the same with even higher user load) and Server response time keep increasing, especially if you are using a Virtual Box to do performance testing, then please be caution!!

Wednesday, June 06, 2012

Deal with Modal Dialog in my WebDriver test

If  you do not have an idea how to deal with the Modal Dialog in WebDriver Tests, here is my solution to it
For example the modal dialog pop-up after clicking "Logout" link, so the code like this:
 driver.findElement(By.linkText("Logout")).click();  
 driver.switchTo().activeElement().sendKeys(Keys.ENTER);  
 driver.switchTo().alert().accept();  

"Mouse" hover to your WebElement as a bonus in case you are looking for:
 //simulate the mouse hover  
 Actions builder = new Actions(ldriver);  
 Action action = builder.moveToElement(sportslink).build();  
 action.perform();  
Hope it helps!

Sunday, June 03, 2012

Performance doc written by me and the team

First of all, Thanks to Neil Feng, if you are not pushing me hard, I won't write something down :) Thank you and the team!You are awesome guys!!

I think it is a good things can be shared with anyone who is interested in performance engineering stuff, so in case you want to take peek at it...:

https://docs.google.com/open?id=0B_hz_q1i5QXJTXZqd0FVblAzNms 

Hope it helps! Any comments or suggestions are welcomed!

--Cheng Chi

Monday, May 07, 2012

Add time stamp to your GC log file name

To avoid overwriting your gc log once the service restart expected, you had better to add a time stamp to your gc log file, simply as this:
 rem Tested FOR WIN7 OS:  
 rem set time format:  
 set hour=%time:~0,2%  
 if "%hour:~0,1%" == " " set hour=0%hour:~1,1%  
 set min=%time:~3,2%  
 if "%min:~0,1%" == " " set min=0%min:~1,1%  
 set secs=%time:~6,2%  
 if "%secs:~0,1%" == " " set secs=0%secs:~1,1%  
 rem set date format:  
 set year=%date:~-8,4%  
 set month=%date:~0,2%  
 if "%month:~0,1%" == " " set month=0%month:~1,1%  
 set day=%date:~3,2%  
 if "%day:~0,1%" == " " set day=0%day:~1,1%  
 set datetime=%year%%month%%day%_%hour%%min%%secs%  
 set GCLOG=-XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:gc-%datetime%.log  
The output like this: gc-20120507_172101.log
Notice: "-XX:+PrintGCDateStamps" option is only available for JDK6u4+, otherwise, you need add "-XX:+PrintGCTimeStamps" instead. Never leave any space at the end of line in your batch script, it will trigger stupid result...