Getting Started - Thrift Load Test

88 views
Skip to first unread message

Kumar Pratik

unread,
Nov 9, 2013, 11:19:34 PM11/9/13
to iago-...@googlegroups.com
Hello,

I have done the basic setup of Iago and ran echo example file as well.
Now I am little confused as in where I have to start with. This is my use case:
I have to perform load test of couple of java thrift APIs.

I have java thrift client jar and all other jar files.
Could you please help me in getting started?

Thanks,
Pratik

Trisha Quan

unread,
Nov 11, 2013, 4:33:03 PM11/11/13
to iago-...@googlegroups.com
Hey Pratik,

So as the echo example shows, the way that parrot works is to specify or write a custom processor, that takes in the log lines and translates them into requests for the client, that then hits an end service.

The overall structure should look something like this:
- You want to include the parrot jar as a dependency and run LauncherMain as your main class but also include your client jar so you can import the client/endpoint to send a request.
- The config should specify the log, processor, and other parameters that are shown in the documentation.
- Then running should let the LauncherMain launch the feeder and server, use the custom processor to turn the log lines into requests that the imported client sends off to the server.

https://github.com/twitter/iago#implementing-your-test is a good place to start for writing your own processor. Please let us know if you have any specific questions beyond the documentation!


Cheers,
Trisha



--
 
---
You received this message because you are subscribed to the Google Groups "Iago Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iago-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Kumar Pratik

unread,
Nov 12, 2013, 5:23:36 AM11/12/13
to iago-...@googlegroups.com
Thanks Trisha.

After reading and based on my understanding here is what I have done so far:
1. Created a new maven package and added all dependencies,repositories,pluginRepositories related to  Iago and my thrift client.
2. Created a new sampleLoadTest class inside src/main/java which has following code:

public class SampleLoadTest extends ThriftLoadTest{

SampleServiceReadClient sampleClient = null;
public SampleLoadTest(ParrotService<ParrotRequest, byte[]> pService) {
super(pService);
sampleClient = new SampleServiceReadClient("localhost", 8080);
}

@Override
public void processLines(List<String> lines) {
for(String line: lines) {
SampleTargetingResponse resp = null;
try {
resp = sampleClient.getAddressTargeting(1097195819, 94);
} catch (TServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (TException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

        }
}

}

3. my config\sample.scala file is
import com.twitter.parrot.config.ParrotLauncherConfig

new ParrotLauncherConfig {
  jobName = "load_echo"
  port = 8081
  victims = "localhost"

  // traceLevel = com.twitter.logging.Level.TRACE

  // log = "your_input_file_here.log"
  log = "config/test.log"
  requestRate = 1
  duration = 15
  timeUnit = "MINUTES"
  reuseFile = true
  localMode = true

  imports = "import com.ci.pratik.SampleLoadTest"
  responseType = "SampleTargetingResponse"
  transport = "ThriftTransport"
  loadTest = "new SampleLoadTest(service.get)"
}

I have couple of questions now:
1. How would I get Future reponse?
2. Do i need to create scala classes for my thrift service?
3. How would I run my test?

Thanks,
Pratik

Kumar Pratik

unread,
Nov 13, 2013, 9:27:15 PM11/13/13
to iago-...@googlegroups.com
Any response?
Reply all
Reply to author
Forward
0 new messages