zorglub76
zorglub76

Reputation: 4942

JMeter - simulating new and old visitors

I need to simulate the following:

What is the best way to model this in JMeter (is it even possible)?

Upvotes: 0

Views: 3027

Answers (2)

user1396181
user1396181

Reputation:

Several notes maybe useful first (sorry if already known):

  • use HTTP Cache Manager, "Use Cache Control/Expires header when processing GET requests" checked.
    If the Cache Manager detects a match, it will add If-Last-Modified and If-None-Match conditional headers to the request. This will speed up the response if true, as the response will be much smaller.
  • following HTTP Request options, to emulate browser behavior:
    • Retrieve All Embedded Resources from HTML Files
    • Use concurrent pool
    • Size
  • possibly Throughput Controller - to apply percentages as per your scenario above - but it would work properly only if you have more then 1 iteration.

Your solution can possibly look like below (HTTP Cache Manager at the Thread Group level):



    Thread Group
    Number of Threads = N
    Loop Count = 1
        HTTP Cache Manager
        Throughput Controller // CACHING
        Percent Executions
        Throughput = 60
        Per User unchecked
            Simpler Controller  // COMMON PAGES
                HTTP Request 01
                HTTP Request 02
                HTTP Request 03
            Loop Controller     // REST OF PAGES
            Loops = 7 [10 - 3 pages]
                Throughput Controller
                Percent Executions
                Throughput = 20
                    Random Controller
                        HTTP Request 04
                        . . .
                        HTTP Request 10
        Random Order Controller  // TESTING
            [requests to pages to test]
            HTTP Request 01
            . . .
            HTTP Request 10

"Cached" requests will have the following details (in View Results Tree listener e.g.):

  • Load time = Latency;
  • Body size in bytes = 0;
  • Response code: 304
  • Response message: Not Modified

Upvotes: 4

Oliver Lloyd
Oliver Lloyd

Reputation: 5004

The easiest thing here is to just work out what level of traffic you expect to hit the server you are testing and model this using jmeter instead. If a browser has a value cached then in effect it will not make the call so the request never happens so you don't need to simulate this, you just don't make the request.

To model the traffic against the server you should think in terms of requests per sec/min. You could also breakdown this throughput level for different types of page or request. Maybe the homepage has a higher throughput than a section page for example. Once you have the data for each type you can setup your test to run at this level.

Upvotes: 0

Related Questions