jeudi 1 septembre 2016

Issue while doing Unit Testing for Code Performance

I was testing my code to check how it will behave if we think that 100 users submitted their registration all at once !!!

My code is in PHP Laravel 5.2 and JQuery Ajax is below.

for (i = 0; i < 100; i++) {
    var 
     data={'Role' : "Role"+i},
     request = $.ajax({
        url:                'http://localhost:1234/Practise/public/api/SaveRoleApi',
        type:               "POST",
        data:               JSON.stringify(data),
        contentType:        "application/json; charset=utf-8",
        async:  true,
        success: function(d){ console.log(d); }
     });
}

Out of 100, I am not successful in submitting more then 88 records.

I am using MySQL Database.

Am I doing something incorrect?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire