Funkload API testing

540 Views Asked by At

So I want to use funkload to stress test an API. I have a set of urls in the test

The thing is the authentication is sent via querystring on every request (no cookies involved)

so /abc?auth=token1 would be one user and /abc?auth=token2 is another

I have code similar to this:

class Simple(FunkLoadTestCase):

    def setUp(self):
        # fetch urls from a file ... ending up with something like
        urlList = ['http://localhost/abc?auth=1', 'http://localhost/def?auth=1']
        self.urlList = urlList

    def test_simple(self):
        for url in self.urlList:
            self.get(url, description='Get url')

The problem is that the server relies heavily on memcached so running the same user concurrently x times only puts the server on proper load on the 1st request.

I am looking for a way for to identify what concurrent user I am running as so I can modify the authentication token per concurrent user.

Any ideas?

1

There are 1 best solutions below

0
On BEST ANSWER

For anyone running into a similar problem. I figured out how to do it using the credential server. Instead of actually having username:password in passwords.txt I used name:authkey.

Another method but not scalable to running multiple load generation servers that you do have access to self.thread_id so you can know which thread/user you are running as.