apigee / apib Goto Github PK
View Code? Open in Web Editor NEWA simple, fast HTTP and API benchmarking tool
License: Apache License 2.0
A simple, fast HTTP and API benchmarking tool
License: Apache License 2.0
FWIW, to avoid errors (missing libs) at the linker stage, I had to replace -lcrypto.1.1
with -lcrypto
and -lssl.1.1
with -lssl
. This fixes the following errors:
/usr/bin/ld: cannot find -lssl.1.1
/usr/bin/ld: cannot find -lcrypto.1.1
After that, there was another error:
/usr/bin/ld: CMakeFiles/io.dir/apib_iothread.cc.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
This was fixed by adding the -pthread
flag in the linker stage.
CentOS on the standard EC2 instances and Ubuntu need -lpthread to be added in the Makefile but the configure script doesn't appear to be adding them.
Add as input a file name and calculate a CRC-32. Calculate the number of responses that match the original file name.
With a little research, though, it looks like doing CRC-32 at a high rate may result in way too much CPU consumption.
I think that we had it on the query line because of a limitation of some other software.
Hi,
I need to capture the response of POST request to a csv file and need to analyze that file later. Is there a way to do it in apib?
example :
./apib -x POST -f request.json -t application/json -c 100 -d 10 -S -N response http://api.foo.com/bars/1
Disclaimer: I don't know autoconf
but it seems to me the Configure.ac file assumes the apr is in /usr/include/apr-1 and the apr-util likewise. Is this a standard location?
I retrieved and built apr and apr-util for MACOSX but did not install them there. Instead they were in /usr/local/apr/include/apr-1 and /usr/local/apr-util/include/apr-1 . I couldn't figure out how to tell configure these locations . So this is possibly a doc update, and possibly a change to configure.ac.
I was able to get the build to succeed only by manually modifying the Makefile, to insert the -I/usr/local/apr/include/apr-1 etc.
When testing a webapp hosted in Caucho Resin (http://www.caucho.com/) on Ubuntu 12.10 (Linux 3.7.0 x86_64), apib-1.0 hangs unless "chunked encoding" is disabled.
Reported by Jorge Chandra on Google Code.
Sometimes we haven't got the SSL set up properly yet, and it would be nice to be able to skip cert verification.
it seem apib is a good tool;
how to install it in centos6.5?
In file included from /home/pirate/optool/apib-master/apib/apib_io_basic.cc:29:0:
/home/pirate/optool/apib-master/apib/apib_iothread.h:36:16: fatal error: ev.h: No such file or directory
#include "ev.h"
^
compilation terminated.
make[3]: *** [apib/CMakeFiles/io.dir/apib_io_basic.cc.o] Error 1
make[2]: *** [apib/CMakeFiles/io.dir/all] Error 2
make[1]: *** [apib/CMakeFiles/apib.dir/rule] Error 2
make: *** [apib] Error 2
If I make less than 100 requests, the 50%, 90%, 98%, and 99% latency values will be the same as the minimum latency value. For example:
Minimum latency: 4013.502 milliseconds
50% latency: 4013.502 milliseconds
90% latency: 4013.502 milliseconds
98% latency: 4013.502 milliseconds
99% latency: 4013.502 milliseconds
This is due to a bug in how the latency percentages are calculated. apib is doing int arithmetic, which rounds down the index of the percentile:
#getLatencyPercent method in apib/src/apib_reporting.c
static unsigned long getLatencyPercent(int percent)
{
if (latenciesCount == 0) {
return 0;
}
if (percent == 100) {
return latencies[latenciesCount - 1];
}
unsigned int index =
(latenciesCount / 100) * percent;
return latencies[index];
}
As you can see in (latenciesCount / 100) * percent;
, (latenciesCount / 100)
will always be 0 if the count is less than 100. This should be changed to float arithmetic. I was interested in using this script purely to measure median/90% latency figures, so unless this is corrected, I cannot use this script.
I build from current master HEAD and I'm getting:
Name,Throughput,Avg. Latency,Threads,Connections,Duration,Completed,Successful,Errors,Sockets,Min. latency,Max. latency,50%% Latency,90%% Latency,98%% Latency,99%% Latency,Latency Std Dev,Avg Client CPU,Avg Server CPU,Avg Server 2 CPU,Client Mem Usage,Server Mem,Server 2 Mem,Avg. Send Bandwidth,Avg. Recv. Bandwidth
test,71.991,13.6991,1,1.000,72,72,0,73,11.751,52.649,13.035,14.236,19.313,52.649,4.791-nan,-nan,-nan,4.89,0.00,0.00,0.66,0.11
There are two missing fields in the output. Obviously a missing comma before the first -nan accounts for one. It appears based on reasonable numbers is that Duration is missing.
Also, the -nan is likely expected as I'm running this from a Docker container.
Building apib is not documented for MACOSX.
It relies on apr and apr-util; the builder needs to retrieve these from http://www.apache.org/dist/apr/ , and then build them.
The location of the includes for these things needs to be referenced somehow, in the configure.ac file or somehting.
The build also (maybe, not sure) relies on autoconf, which is not included in this distribution. Autoconf can be retrieved and built, using http://mirror.team-cymru.org/gnu/autoconf .
Does not support http2,
When compiled from master, I receive the following:
pivotal@astandke-scaling:~/apib$ ./apib -S -d 5 -N nantest https://astandke.com
nantest,25.799,38.5591,1,5.000,129,129,0,2,36.238,164.864,36.500,36.650,47.397,163.614,15.811-nan,-nan,-nan,4.18,0.00,0.00,0.01,0.56
(scroll to the right, note the -nan
s)
I checked out an arbitrarily old commit (2a603ea) and saw the output I expect:
pivotal@astandke-scaling:~/apib$ ./apib -S -d 5 -N nantest https://astandke.com
nantest,25.599,38.929,1,1,5.000,128,128,0,2,36.185,180.611,36.622,36.844,56.925,164.646,16.998,0,0,0,4,0,0,0.01,0.56
The version in homebrew seems to be correct though, so it's just something since then.
Support the length as either a command-line parameter, or as a filename to check. Report the number of responses with a non-matching length. Or, take the length of the very first response.
Requires apib to validate content-length, and also to count length when using chunked encoding.
Being able to install via brew install apib
would be handy.
apib just needs a version tag, e.g. 0.1.
Check discussion here:
Homebrew/legacy-homebrew#23438
For my purposes, I would like to use the old ab -n option to set a specific number of requests rather than duration. It would be mutually exclusive of -d.
apib today (like ab) does a single DNS lookup at the start of processing, regardless of the number of connections.
This is fine for most servers but for DNS-based load balancing services such as Amazon ELB, performance is not as good as it should be.
Instead, we should experiment with doing a DNS lookup for each concurrent connection, or even with doing a DNS lookup periodically when opening a new connection. This will better help us test the highly variable throughput produced by ELB.
I have been using apib to test the performance of an embedded web server.
This is a small device, so the overhead of some ciphers can be significant. I added an option to apib to specify the suite or suites to be offered to the server, using the OpenSSL names:
./apib -C AES128-SHA:ECDHE-RSA-AES256-SHA384 https://10.28.22.4/index.html
Diff attached
apib.txt
With this option, apib has been of great help in testing and tweaking our device. Thanks!
Hi, thanks for the nice tool! While porting it to FreeBSD, I've discovered that it lacks CPU and memory statistics collection code for this OS and patched it. If you like the patch, it would be nice to see it included upstream, i.e., pushed to master. :-)
P.S. Speaking of versions: existing APIB_1_0
release tag is very old. Perhaps it is time for the new version? (Given that not too many changes had occurred during the time frame, it could probably be tagged as 1.1
or v1.1
.)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.