generated from irods/irods_project_template_cpp_client
-
Notifications
You must be signed in to change notification settings - Fork 8
/
apache_bench.txt
21 lines (16 loc) · 1.3 KB
/
apache_bench.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#
# How to do performance testing using Apache Bench
#
# Test Authentication endpoint
#
# "-p" instructs "ab" to send a post request. Normally, the file passed would contain URL encoded data, but
# for this application, the endpoint doesn't accept any data other than the "Authorization" header.
ab -A '<username>:<password>' -p <empty_file> -n <total_requests> -c <total_concurrent_requests> 'http://localhost:<port>/irods-http-api/<version>/authenticate'
# To test other things, get a bearer token by running the following first.
bearer_token=$(curl -s -X POST --user '<username>:<password>' 'http://localhost:<port>/irods-http-api/<version>/authenticate')
# Stat'ing a collection.
ab -n <total_requests> -c <total_concurrent_requests> -H "Authorization: Bearer $bearer_token" 'http://localhost:<port>/irods-http-api/<version>/collections?op=stat&lpath=/tempZone/home/<username>'
# Stat'ing a resource.
ab -n <total_requests> -c <total_concurrent_requests> -H "Authorization: Bearer $bearer_token" 'http://localhost:<port>/irods-http-api/<version>/resources?op=stat&name=demoResc'
# Reading bytes in a data object.
ab -n <total_requests> -c <total_concurrent_requests> -H "Authorization: Bearer $bearer_token" 'http://localhost:<port>/irods-http-api/<version>/data-objects?op=read&lpath=/tempZone/home/<username>/foo&count=8192'