|# post_loc.txt contains the json you want to post|
|# -p means to POST it|
|# -H adds an Auth header (could be Basic or Token)|
|# -T sets the Content-Type|
|# -c is concurrent clients|
|# -n is the number of requests to run in the test|
|ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/|
I got the result ( different metrics to understand the various output values returned by ab) when I use the above with slight change. The command line statement should look like this : For example:
First install apache sever,then open bin folder inside apache,open command prompt and type the command as given below
ab -p C:\Users\Dell\Desktop\ab\smartinvoice.txt -T application/json -H '1ef632f7-02fe-41cd-beec-a1f9bb8cae03' -c 100 -n 1000 http://localhost:3036/app/smartinvoice/document/smartinvoice
The output is as follows:
Benchmarking localhost (be patient)
Document Path: /app/home#/smartinvoiceform//views//
Concurrency Level: 100
Connection Times (ms)
Percentage of the requests served within a certain time (ms)
Give small values for c and n. Then increase these values until we get failure cases to see different cases.
But records are not saved in the db.
Is it possible to store data from text file(in our post_loc.txt) into db using apache benchmarking command mentioned below:
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
Do we need to specify db name or db related information to store json data in the text file ?