From ed6a52e525ad4bf3089b925e3415736e738e30dc Mon Sep 17 00:00:00 2001 From: Scott Grasley Date: Tue, 19 Dec 2017 12:04:13 -0800 Subject: [PATCH] Add read performance testing to monasca-api Using Jmeter to query monasca-api and collect performance numbers related to database performance and monasca-api interaction. Change-Id: I315453453b82d90874aefada6f4ac3337512f4e7 story: 2001292 task: 6113 --- perf/README.md | 34 ++ perf/monasca_query_test.jmx | 624 ++++++++++++++++++++++++++++++++++++ 2 files changed, 658 insertions(+) create mode 100644 perf/README.md create mode 100644 perf/monasca_query_test.jmx diff --git a/perf/README.md b/perf/README.md new file mode 100644 index 000000000..77ea62af5 --- /dev/null +++ b/perf/README.md @@ -0,0 +1,34 @@ + +monasca-api performance benchmarking +============= + +Recommended Configuration +============= + +Install +======= + +Install JMeter + +JMeter can be found at http://jmeter.apache.org/download_jmeter.cgi + +add JMeter bin to the path: PATH=$PATH:~/.../bin + +Monasca-query performance test +============================== + +This test is designed to work with data created from persister-perf performance test but +can work with any monasca-api/db configuration. +monasca-api will need to have region configured to support test data. +JMeter uses monasca-api to query db backend. + +Load monasca_query_test.jmx into jmeter. +Setup user defined variables for your environment. + + keystone_server keystone server ip address + monasca-api_server monasca-api server ip address + keystone_user admin keystone user with monitoring permissions + keystone_password secretadmin password for keystone user + tenant_id tenant_1 tenant id set in monascas-api/keystone. + +Run tests. diff --git a/perf/monasca_query_test.jmx b/perf/monasca_query_test.jmx new file mode 100644 index 000000000..9146ab05f --- /dev/null +++ b/perf/monasca_query_test.jmx @@ -0,0 +1,624 @@ + + + + + + false + true + + + + + + + + continue + + false + 1 + + 1 + 1 + 1511277511000 + 1511277511000 + false + + + + + + + + keystone_server + 10.84.43.189 + = + keystone server ip address + + + monasca-api_server + 10.84.43.189 + = + monasca-api server ip address + + + keystone_user + admin + = + keystone user with monitoring permissions + + + keystone_password + secretadmin + = + password for keystone user + + + tenant_id + tenant_1 + = + tenant id set in monascas-api/keystone. + + + loop_count + 5 + = + + + + + + true + + + + false + {"auth": {"scope": {"project": {"domain": {"id": "default"}, "name": "${keystone_user}"}}, "identity": {"password": {"user": {"domain": {"id": "default"}, "password": "${keystone_password}", "name": "${keystone_user}"}}, "methods": ["password"]}}} + = + + + + ${keystone_server} + + + + /identity/v3/auth/tokens + POST + true + false + true + false + + HttpClient4 + + + + + + + + Content-type + application/json + + + + + + true + Token + X-Subject-Token: (.+?)\s + $1$ + Doah! + 1 + all + Token + + + + + true + ${loop_count} + + + + true + + + + false + + = + + + + ${monasca-api_server} + 8070 + + + /v2.0/metrics?tenant_id=${tenant_id}&limit=2 + GET + true + false + true + false + + + + + + + + + Accept + application/json + + + X-Auth-Token + ${Token} + + + + + + + + true + ${loop_count} + + + + true + + + + false + + = + + + + ${monasca-api_server} + 8070 + + + /v2.0/metrics?tenant_id=${tenant_id}&limit=9000 + GET + true + false + true + false + + + + + + + + + Accept + application/json + + + X-Auth-Token + ${Token} + + + + + + + + true + ${loop_count} + + + + true + + + + false + + = + + + + ${monasca-api_server} + 8070 + + + /v2.0/metrics?tenant_id=${tenant_id}&dimensions=${dimension_name_1}:${dimension_value}&name=${metric_name}&limit=9000 + GET + true + false + true + false + + + + + + + + + Accept + application/json + + + X-Auth-Token + ${Token} + + + + + + + + true + ${loop_count} + + + + true + + + + false + + = + + + + ${monasca-api_server} + 8070 + + + /v2.0/metrics/dimensions/names?tenant_id=${tenant_id} + GET + true + false + false + false + + + + + + + dimension_name + $..dimension_name + -1 + all + + + + + + Accept + application/json + + + X-Auth-Token + ${Token} + + + + + + + + true + ${loop_count} + + + + true + + + + false + + = + + + + ${monasca-api_server} + 8070 + + + /v2.0/metrics/dimensions/names/values?tenant_id=${tenant_id}&dimension_name=${dimension_name_1} + GET + true + false + false + false + + + + return all of the hostnames values. + + + + dimension_value + $..dimension_value + 0 + all + + + + + + Accept + application/json + + + X-Auth-Token + ${Token} + + + + + + + + true + ${loop_count} + + + + true + + + + false + + = + + + + ${monasca-api_server} + 8070 + + + /v2.0/metrics/names?tenant_id=${tenant_id} + GET + true + false + false + false + + + + + + + metric_name + $..name + 0 + all + + + + + + Accept + application/json + + + X-Auth-Token + ${Token} + + + + + + + + true + ${loop_count} + + + + true + + + + false + + = + + + + ${monasca-api_server} + 8070 + + + /v2.0/metrics/measurements?tenant_id=${tenant_id}&name=${metric_name}&dimensions=${dimension_name_1}:${dimension_value}&start_time=2014-07-18T00:00:01&group_by=dimension + GET + true + false + false + false + + + + + + + + + Accept + application/json + + + X-Auth-Token + ${Token} + + + + + + + + true + ${loop_count} + + + + true + + + + false + + = + + + + ${monasca-api_server} + 8070 + + + /v2.0/metrics/statistics?name=${metric_name}&tenant_id=${tenant_id}&dimensions=${dimension_name_1}:${dimension_value}&start_time=2014-07-18T00:00:01Z&statistics=avg,min,max,sum,count&end_time=${__time(yyyy-MM-dd)}T23:59:59Z&group_by=dimension + GET + true + false + false + false + + + + + + + + + Accept + application/json + + + X-Auth-Token + ${Token} + + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + + + + + + + false + + saveConfig + + + true + true + true + + true + true + true + true + false + true + true + false + false + false + true + false + false + false + true + 0 + true + true + true + true + true + + + + Response Time Graph + true + + + + + + true + + + +