loadrunner - Simulating huge Json data in web_custom_request -
i need check performance of excel file upload in .net application mongodb. facing issue how fix this. here when excel file uploaded recorded in json format in web_custom_request. file content converted json format @ ui level , parsed server. have tried adding multipart/form data , file path no success. captured requests using fiddler same requests recorded.
below script recorded 2 records of data in body.
web_custom_request("import", "url=http://www.neoint.ai/neointapidbqa/api/definitiondata/import/?isdefinition=true", "method=post", "targetframe=", "resource=0", "reccontenttype=application/json", "referer=http://www.neoint.ai/neointwebdbqa/upload/enterprise%20sales%20area", "snapshot=t16.inf", "mode=html", "enctype=application/json;charset=utf-8", "body=[[{\"neointid\":\"\",\"definitionneointid\":\"\",\"esa_level_2\":\"ap\",\"esa_level_1\":\"hyderabad\",\"esa_level_3\":\"hyderabad\",\"esa_level_4\":\"secunderbad\"}," "{\"esa_level_2\":\"ap\",\"esa_level_1\":\"vizag\",\"esa_level_3\":\"vizag\",\"esa_level_4\":\"vizag\"}]," "[{\"\":\"\",\"templateid\":\"f854f762-a77e-4bb3-8945-07aefce52e36\",\"fileid\":\"62670\"}],\"mliquidateenterprise sales areaprofiles.xlsx\"]", extrares, "url=/neointapidbqa/api/getfailedprofiles/2", "referer=http://www.neoint.ai/neointwebdbqa/upload/enterprise%20sales%20area", enditem, last); logic implemented in application:
var file = $scope.selectedfile; if (file) { var reader = new filereader(); reader.onload = function (e) { var data = e.target.result; var dataobjects = []; var workbook = xlsx.read(data, { type: 'binary' }); (var = 0; < workbook.sheetnames.length; i++) { var first_sheet_name = workbook.sheetnames[i]; dataobjects.push(xlsx.utils.sheet_to_json(workbook.sheets[first_sheet_name])); } debugger; dataobjects.push($scope.selectedfile.name); if (dataobjects.length > 0) { var currentdate = $filter('date')(new date(), "mm/dd/yyyy / hh:mm:ss"); var uplaodedfile = { "filename": $scope.selectedfile.name, "datetime": currentdate, "failedcount" : 0, "uploadstatus": "inprogress" }; i have check huge no of records in excel file , check performance.
can 1 advice me how solve this.
here basic structure, not accounting escaped quotes (backslash+double quote). have added line feeds ease reading
[ [ { “neointid":"", "definitionneointid":"", "esa_level_2":"ap", "esa_level_1":"hyderabad", "esa_level_3":"hyderabad", "esa_level_4":"secunderbad" } ,"" { "esa_level_2":"ap", "esa_level_1":"vizag", "esa_level_3":"vizag", "esa_level_4":"vizag" } ] ,"" [ { "":"", "templateid":"f854f762-a77e-4bb3-8945-07aefce52e36", "fileid":"62670" } ] ,"mliquidateenterprise sales areaprofiles.xlsx" ] record several different examples, 1 single row, 2 rows, ten rows. should find repeating pattern associated rows can build using foundation skills in c string construction. fileid looks unique identifier. suspect correlated value, need handle correctly well.
be wary of having heavy file i/o on load generators. find once above 10-15 virtual users going start waiting on read head virtual users contend access drive. same thing happens when have log level high , users have wait on write access. net result file system becomes drag anchor behind speed boat, slowing down load generator.
have considered placing values need in parameter file , using loadrunner functions associated advancing loadrunner parameter row pull in additional data in loop? large advantage here the loadrunner parameter files loaded ram @ beginning of test there no disk contention amongst virtual users on read. explains why cannot write parameter file virtual user , have new value read automatically virtual user b during same test....because file being written not being used - copy in ram being used test.
Comments
Post a Comment