Integrate with HdrHistogram to support compression

1. Integrate with HdrHistogram which supports JSON compression;
2. Fix the dependencies list;

Change-Id: Ia0a928522e800a79f8580b3ffb3f3406d7c148d7
This commit is contained in:
Yichen Wang 2015-08-13 11:28:58 -07:00
parent ce99372aae
commit 2fc1e6df28
5 changed files with 39 additions and 29 deletions

View File

@ -64,7 +64,23 @@ sed -i "s/^exit\s0/python \/kb_test\/kb_vm_agent.py \&\n\0/g" /etc/rc.local
# python redis client
pip install redis
# install the http traffic generator
# Download cmake
cd /tmp
wget http://www.cmake.org/files/v3.3/cmake-3.3.0-Linux-x86_64.tar.gz
tar xzf cmake-3.3.0-Linux-x86_64.tar.gz
# Install HdrHistorgram_c
git clone git://github.com/HdrHistogram/HdrHistogram_c.git
cd HdrHistogram_c
/tmp/cmake-3.3.0-Linux-x86_64/bin/cmake .
make install
# Remove cmake and HdrHistogram_c builds
rm /tmp/cmake-3.3.0-Linux-x86_64.tar.gz
rm -rf /tmp/cmake-3.3.0-Linux-x86_64
rm -rf HdrHistogram_c
# Install the http traffic generator
git clone git://github.com/yicwang/wrk2.git
cd wrk2
make
@ -72,7 +88,10 @@ mv wrk /usr/local/bin/wrk2
cd ..
rm -rf wrk2
# uninstall unneeded packages
# Move the HdrHistogram library to /usr/lib
mv /usr/local/lib/libhdr_histogram.so /usr/lib/
# Uninstall unneeded packages
apt-get -y --purge remove git
apt-get -y --purge remove python-pip
apt-get -y --purge remove build-essential

View File

@ -28,7 +28,7 @@ import redis
# requirements to run, and stopped with an error if not.
#
# Note: All majors are compatible regardless of minor.
__version__ = '1.0'
__version__ = '2.0'
class KB_Instance(object):
@ -88,7 +88,7 @@ class KB_Instance(object):
report_interval):
if not rate_limit:
rate_limit = 65535
cmd = '%s -t%d -c%d -R%d -d%ds -p%ds --timeout %ds -D2 -j %s' % \
cmd = '%s -t%d -c%d -R%d -d%ds -p%ds --timeout %ds -D2 -e %s' % \
(dest_path, threads, connections, rate_limit, duration,
report_interval, timeout, target_url)
return cmd

View File

@ -38,7 +38,7 @@ import tenant
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
KB_IMAGE_MAJOR_VERSION = 1
KB_IMAGE_MAJOR_VERSION = 2
class KBVMCreationException(Exception):
pass
@ -412,8 +412,6 @@ class KloudBuster(object):
except Exception:
traceback.print_exc()
KBResLogger.dump_and_save('clt', self.testing_kloud.res_logger.resource_list)
if kbrunner:
kbrunner.dispose()
def get_tenant_vm_count(self, config):
return (config['users_per_tenant'] * config['routers_per_user'] *

View File

@ -36,7 +36,7 @@ class WrkTool(PerfTool):
duration_sec = self.instance.config.http_tool_configs.duration
if not rate_limit:
rate_limit = 65535
cmd = '%s -t%d -c%d -R%d -d%ds --timeout %ds -D2 -j %s' % \
cmd = '%s -t%d -c%d -R%d -d%ds --timeout %ds -D2 -e %s' % \
(self.dest_path, threads, connections, rate_limit,
duration_sec, timeout, target_url)
LOG.kbdebug("[%s] %s" % (self.instance.vm_name, cmd))
@ -48,23 +48,13 @@ class WrkTool(PerfTool):
# Sample Output:
# {
# "seq": 1,
# "latency": {
# "min": 509440, "max": 798720,
# "counters": [
# 8, [1990, 1, 2027, 1],
# 9, [1032, 1, 1058, 1, 1085, 1, 1093, 1, 1110, 1, 1111, 1,
# 1128, 1, 1129, 1, 1146, 1, 1147, 1, 1148, 1, 1165, 1, 1166, 1, 1169, 1,
# 1172, 1, 1182, 1, 1184, 1, 1187, 1, 1191, 1, 1201, 1, 1203, 1, 1206, 1,
# 1209, 1, 1219, 1, 1221, 1, 1223, 1, 1235, 1, 1237, 1, 1239, 1, 1242, 1,
# 1255, 1, 1257, 1, 1260, 1, 1276, 1, 1282, 1, 1286, 1, 1294, 1, 1308, 1,
# 1312, 1, 1320, 1, 1330, 1, 1334, 1, 1346, 1, 1349, 1, 1352, 1, 1364, 1,
# 1374, 1, 1383, 1, 1401, 1, 1427, 1, 1452, 1, 1479, 1, 1497, 1, 1523, 1,
# 1541, 1, 1560, 1]
# ]
# },
# "total_req": 29, "rps": 29.39, "rx_bps": "1.43MB",
# "hist": "HISTggAAANB4nO3XsQ3DIBAAQFBWcJnskc6reJMokjfIcF7DI9iS3bkIFBg"
# "k7iRE8wU88Hqe8+8b4ucdDo9zjvsYXssUxjUAAAAAAAAAAAAAAAAAAAAAAA"
# "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
# "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQKpYKS5V6+sDAACu7u7P/Rvq"
# "kKe65L9tuefTaj2EnngXdeXWr1L17l98r/ek1323plR/ETdacAUk"
# "errors": {"read": 1},
# "total_req": 58, "rps": 28.97, "rx_bps": "1.48MB"
# }
try:
@ -94,7 +84,7 @@ class WrkTool(PerfTool):
http_sock_timeout = 0
http_err = 0
latency_stats = result['latency']
latency_stats = result['hist']
except Exception:
return self.parse_error('Could not parse: "%s"' % (stdout))
@ -125,9 +115,9 @@ class WrkTool(PerfTool):
# for item in results:
# print item['results']['latency_stats']
all_res['latency_stats'] = []
histogram = HdrHistogram(1, 3600 * 1000 * 1000, 2)
histogram = HdrHistogram(1, 24 * 3600 * 1000 * 1000, 2)
for item in results:
histogram.add_bucket_counts(item['results']['latency_stats'])
histogram.decode_and_add(item['results']['latency_stats'])
perc_list = [50, 75, 90, 99, 99.9, 99.99, 99.999]
latency_dict = histogram.get_percentile_to_value_dict(perc_list)
for key, value in latency_dict.iteritems():

View File

@ -2,13 +2,16 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pbr>=0.6,!=0.7,<1.0
pbr>=1.3
Babel>=1.3
configure>=0.5
hdrhistogram>=0.0.4
hdrhistogram>=0.1.1
oslo.log>=1.0.0
pecan>=0.9.0
python-openstackclient>=1.5.0
redis>=2.10.3
tabulate>=0.7.3
# Workaround for pip install failed on RHEL/CentOS
functools32>=3.2.3