monasca-persister/perf/jmeter_test_plan.jmx
James Gu 169f2c3ca3 Add performance testing in Monasca persister
Leverages the JMeter and KafkaMeter to inject into persister metric
messages with permutation of random metric names and dimensions.
Monitors the metrics flushed to the database in all persister
instances and calculates the throughput. The number of metrics and
the number of unique metic definitions are configurable in the test
plan. The script currently supports only the Java implementation of
the Monasca persister. Monasca python does not provide the same
internal metric api as the Dropwizard in the Java implemation.
Future work is required for the Python implemation.

Change-Id: Id8e6a5b62aa434d9943c7eee4be8991536b1c45f
Depends-On: https://review.openstack.org/543399
story: 2001292
task: 5841
2018-02-12 09:53:13 +00:00

171 lines
11 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="3.2" jmeter="3.3 r1808647">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="tenant" elementType="Argument">
<stringProp name="Argument.name">tenant</stringProp>
<stringProp name="Argument.value">t1</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">stoptest</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">80000000</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">2</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1507913213000</longProp>
<longProp name="ThreadGroup.end_time">1507913213000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<CounterConfig guiclass="CounterConfigGui" testclass="CounterConfig" testname="metric_Counter" enabled="true">
<stringProp name="CounterConfig.start">1</stringProp>
<stringProp name="CounterConfig.end">1000000</stringProp>
<stringProp name="CounterConfig.incr">1</stringProp>
<stringProp name="CounterConfig.name">metric_counter</stringProp>
<stringProp name="CounterConfig.format"></stringProp>
<boolProp name="CounterConfig.per_user">false</boolProp>
</CounterConfig>
<hashTree/>
<RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" testname="Random Tenant ID" enabled="true">
<stringProp name="maximumValue">10</stringProp>
<stringProp name="minimumValue">1</stringProp>
<stringProp name="outputFormat">tenant_00</stringProp>
<boolProp name="perThread">true</boolProp>
<stringProp name="randomSeed">${__Random(1, 1000000)}</stringProp>
<stringProp name="variableName">tenant_id</stringProp>
</RandomVariableConfig>
<hashTree/>
<RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" testname="Random Metric Name" enabled="true">
<stringProp name="maximumValue">600</stringProp>
<stringProp name="minimumValue">1</stringProp>
<stringProp name="outputFormat">metric_000</stringProp>
<boolProp name="perThread">true</boolProp>
<stringProp name="randomSeed">${__Random(1000001, 2000000)}</stringProp>
<stringProp name="variableName">metric_name</stringProp>
</RandomVariableConfig>
<hashTree/>
<RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" testname="Random Host Dimension" enabled="true">
<stringProp name="maximumValue">1500</stringProp>
<stringProp name="minimumValue">1</stringProp>
<stringProp name="outputFormat">host_0000</stringProp>
<boolProp name="perThread">true</boolProp>
<stringProp name="randomSeed">${__Random(3000001, 4000000)}</stringProp>
<stringProp name="variableName">host_dim_value</stringProp>
</RandomVariableConfig>
<hashTree/>
<RandomVariableConfig guiclass="TestBeanGUI" testclass="RandomVariableConfig" testname="Random Process Dimension" enabled="true">
<stringProp name="maximumValue">20</stringProp>
<stringProp name="minimumValue">1</stringProp>
<stringProp name="outputFormat">process_000</stringProp>
<boolProp name="perThread">true</boolProp>
<stringProp name="randomSeed">${__Random(5000000, 10000000)}</stringProp>
<stringProp name="variableName">process_dim_value</stringProp>
</RandomVariableConfig>
<hashTree/>
<JavaSampler guiclass="JavaTestSamplerGui" testclass="JavaSampler" testname="kafka Request" enabled="true">
<elementProp name="arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" enabled="true">
<collectionProp name="Arguments.arguments">
<elementProp name="kafka_brokers" elementType="Argument">
<stringProp name="Argument.name">kafka_brokers</stringProp>
<stringProp name="Argument.value">192.168.1.2:9092,192.168.1.16:9092</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_topic" elementType="Argument">
<stringProp name="Argument.name">kafka_topic</stringProp>
<stringProp name="Argument.value">metrics</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_key" elementType="Argument">
<stringProp name="Argument.name">kafka_key</stringProp>
<stringProp name="Argument.value">${__time()}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_message" elementType="Argument">
<stringProp name="Argument.name">kafka_message</stringProp>
<stringProp name="Argument.value">{&quot;metric&quot;:{&quot;timestamp&quot;:${__time()},&quot;name&quot;:&quot;${metric_name}&quot;,&quot;dimensions&quot;:{&quot;hostname&quot;:&quot;${host_dim_value}&quot;,&quot;service&quot;:&quot;monitoring&quot;, &quot;process&quot;:&quot;${__Random(1,22)}&quot;},&quot;value&quot;:${metric_counter},&quot;value_meta&quot;:null},&quot;meta&quot;:{&quot;region&quot;:&quot;RegionX&quot;,&quot;tenantId&quot;:&quot;${tenant_id}&quot;},&quot;creation_time&quot;:${__time(/1000,)}}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_message_serializer" elementType="Argument">
<stringProp name="Argument.name">kafka_message_serializer</stringProp>
<stringProp name="Argument.value">org.apache.kafka.common.serialization.StringSerializer</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_key_serializer" elementType="Argument">
<stringProp name="Argument.name">kafka_key_serializer</stringProp>
<stringProp name="Argument.value">org.apache.kafka.common.serialization.StringSerializer</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_ssl_keystore" elementType="Argument">
<stringProp name="Argument.name">kafka_ssl_keystore</stringProp>
<stringProp name="Argument.value">${PARAMETER_KAFKA_SSL_KEYSTORE}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_ssl_keystore_password" elementType="Argument">
<stringProp name="Argument.name">kafka_ssl_keystore_password</stringProp>
<stringProp name="Argument.value">${PARAMETER_KAFKA_SSL_KEYSTORE_PASSWORD}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_ssl_truststore" elementType="Argument">
<stringProp name="Argument.name">kafka_ssl_truststore</stringProp>
<stringProp name="Argument.value">${PARAMETER_KAFKA_SSL_TRUSTSTORE}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_ssl_truststore_password" elementType="Argument">
<stringProp name="Argument.name">kafka_ssl_truststore_password</stringProp>
<stringProp name="Argument.value">${PARAMETER_KAFKA_SSL_TRUSTSTORE_PASSWORD}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_use_ssl" elementType="Argument">
<stringProp name="Argument.name">kafka_use_ssl</stringProp>
<stringProp name="Argument.value">false</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_compression_type" elementType="Argument">
<stringProp name="Argument.name">kafka_compression_type</stringProp>
<stringProp name="Argument.value"></stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="kafka_partition" elementType="Argument">
<stringProp name="Argument.name">kafka_partition</stringProp>
<stringProp name="Argument.value"></stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="classname">co.signal.kafkameter.KafkaProducerSampler</stringProp>
</JavaSampler>
<hashTree/>
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="false">
<collectionProp name="Arguments.arguments">
<elementProp name="process_dim_value" elementType="Argument">
<stringProp name="Argument.name">process_dim_value</stringProp>
<stringProp name="Argument.value">${__javaScript(Math.floor(Math.random()*22),MYRESULT)}</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</Arguments>
<hashTree/>
</hashTree>
</hashTree>
<WorkBench guiclass="WorkBenchGui" testclass="WorkBench" testname="WorkBench" enabled="true">
<boolProp name="WorkBench.save">true</boolProp>
</WorkBench>
<hashTree/>
</hashTree>
</jmeterTestPlan>