0

lets say if 10 users hitting web service at same time(concurrency),then how we can check performance.

Please share your Ideas

Thanks in Advance..

0

There are a lot of tools out there to test the behaviour of a service or you can always wire up your own script if you just want to measure response time.

  • JMeter
  • LoadUI
  • HP Loadrunner Pro
  • CloudTest

Sample nodejs script which I use to quickly check my service perfomance.

let request = require('request');
let TARGET_URL = 'END point URL';
let CLIENT_ID = "ADD HERE";
let CLIENT_SECRET = "ADD HERE";

// Read this as Fire total 3*5 = 15 request at rate of 5 request per 1000ms(1sec). Repeat 3 times.
let NUMBER_OF_ITERATIONS = 3;
let REQUEST_PER_SECOND = 5;
let FREQUENCY_IN_MILLISECONDS = 1000;

let options = {
    method: 'POST',
    url: 'AUTH URL HERE',
    headers:
        {
            'Content-Type': 'application/x-www-form-urlencoded'
        },
    form:
        {
            grant_type: 'client_credentials',
            client_id: CLIENT_ID,
            client_secret: CLIENT_SECRET
        }
};

request(options, function (error, response, body) {
    if (error) throw new Error(error);
    let token = JSON.parse(body).access_token;
    console.log(body);
    fireRequests(token);
});


function fireRequests(token) {
    for (let j = 0; j < NUMBER_OF_ITERATIONS; j++) {
        setTimeout(function () {
            for (let i = 0; i < REQUEST_PER_SECOND; i++) {
                let changingParameter = "someemail+" + j + Date.now() + "@gmail.com";
                console.log('STARTED ITERATION: ', j, new Date(), email);
                request.post(TARGET_URL, {
                    "json": getJSON(changingParameter),
                    "headers": {
                        "Authorization": "Bearer " + token
                    }
                }, function (err, httpResponse, body) {
                    console.log('FINISHED', j, new Date(), email);
                    console.log(err, body);
                })
            }
        }, j * FREQUENCY_IN_MILLISECONDS, j)
    }
}

function getJSON(email) {
    return {
        // Your request here
    }
}
1
  • Thanks @manjit5190 your answer helped me alot, – purna May 12 '20 at 9:50
1

Depending on the test you have in mind, you may need to contact support first. Salesforce can give you guidance on tools you can use, availability windows, etc. Generally speaking, your performance should be good enough. Salesforce performs regular monitoring of performance and would get in touch with you if there's a problem. Manual testing is probably not necessary for such a small load.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.