From 3b28926870225fce8df70030d931d5027943e775 Mon Sep 17 00:00:00 2001 From: FrancescoFioraEst Date: Thu, 16 Nov 2023 15:18:28 +0000 Subject: Add test prometheus metrics in stability and performance tests Issue-ID: POLICY-4892 Change-Id: Iea8dc2c8cb0457b08c0a5bf5363cbc8073c62bf1 Signed-off-by: FrancescoFioraEst --- .../src/main/resources/testplans/performance.jmx | 163 +++++++++++++++++- .../src/main/resources/testplans/stability.jmx | 183 +++++++++++++++++++-- 2 files changed, 329 insertions(+), 17 deletions(-) mode change 100644 => 100755 testsuites/performance/src/main/resources/testplans/performance.jmx mode change 100644 => 100755 testsuites/stability/src/main/resources/testplans/stability.jmx (limited to 'testsuites') diff --git a/testsuites/performance/src/main/resources/testplans/performance.jmx b/testsuites/performance/src/main/resources/testplans/performance.jmx old mode 100644 new mode 100755 index 8243cae49..3360d1aae --- a/testsuites/performance/src/main/resources/testplans/performance.jmx +++ b/testsuites/performance/src/main/resources/testplans/performance.jmx @@ -18,6 +18,16 @@ 30007 = + + POLICY_PARTICIPANT_HOST + localhost + = + + + POLICY_PARTICIPANT_HOST_PORT + 30008 + = + HOME_PATH ./ @@ -45,12 +55,19 @@ - http://${RUNTIME_HOST}:${RUNTIME_PORT}/onap/policy/clamp/acm/v2 + http://${RUNTIME_HOST}:${RUNTIME_PORT}/onap/policy/clamp/acm runtimeUser zb!XztG34 + + http://${POLICY_PARTICIPANT_HOST}:${POLICY_PARTICIPANT_HOST_PORT}/onap/policyparticipant + participantUser + zb!XztG34 + + + true false @@ -2033,6 +2050,150 @@ vars.put("deployState", deployState); + + false + + + + ${RUNTIME_HOST} + ${RUNTIME_PORT} + http + /onap/policy/clamp/acm/prometheus + GET + true + false + true + false + false + false + false + 6 + false + 0 + + + + + 200 + + + Assertion.response_code + true + 33 + + + + groovy + + + true + def res = []; +if (prev.getResponseCode() == '200') { + res = prev.getResponseDataAsString(); + + assert res.contains("http_server_requests_seconds_sum") + assert res.contains("http_server_requests_seconds_max") + assert res.contains("spring_data_repository_invocations_seconds_count") + assert res.contains("spring_data_repository_invocations_seconds_sum") + assert res.contains("spring_data_repository_invocations_seconds_max") + assert res.contains("jvm_threads_live_threads") + + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"POST\",outcome=\"SUCCESS\",status=\"201\",uri=\"/v2/compositions\",}") + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"PUT\",outcome=\"SUCCESS\",status=\"202\",uri=\"/v2/compositions/{compositionId}\",}") + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"GET\",outcome=\"SUCCESS\",status=\"200\",uri=\"/v2/compositions/{compositionId}\",}") + + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"POST\",outcome=\"SUCCESS\",status=\"201\",uri=\"/v2/compositions/{compositionId}/instances\",}") + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"PUT\",outcome=\"SUCCESS\",status=\"202\",uri=\"/v2/compositions/{compositionId}/instances/{instanceId}\",}") + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"GET\",outcome=\"SUCCESS\",status=\"200\",uri=\"/v2/compositions/{compositionId}/instances/{instanceId}\",}") + + assert res.contains("publisher_automation_composition_state_change_seconds_count") + assert res.contains("publisher_participant_update_seconds_count") + assert res.contains("publisher_participant_status_req_seconds_count") + assert res.contains("publisher_automation_composition_deploy_seconds_count") + + assert res.contains("listener_participant_prime_ack_seconds_count") + assert res.contains("listener_automation_composition_statechange_ack_seconds_count") + assert res.contains("listener_participant_status_seconds_count") +} + + + + + + Accept + text/plain + + + + + + + false + + + + ${POLICY_PARTICIPANT_HOST} + ${POLICY_PARTICIPANT_HOST_PORT} + http + /onap/policyparticipant/prometheus + GET + true + false + true + false + false + false + false + 6 + false + 0 + + + + + 200 + + + Assertion.response_code + true + 33 + + + + groovy + + + true + def res = []; +if (prev.getResponseCode() == '200') { + res = prev.getResponseDataAsString(); + + assert res.contains("http_server_requests_seconds_sum") + assert res.contains("http_server_requests_seconds_max") + assert res.contains("jvm_threads_live_threads") + + assert res.contains("publisher_participant_register_seconds_count") + assert res.contains("publisher_participant_prime_ack_seconds_count") + assert res.contains("publisher_participant_status_seconds_count") + assert res.contains("publisher_automation_composition_update_ack_seconds_count") + + assert res.contains("listener_participant_status_req_seconds_count") + assert res.contains("listener_participant_prime_seconds_count") + assert res.contains("listener_automation_composition_state_change_seconds_count") + assert res.contains("listener_automation_composition_update_seconds_count") +} + + + + + + Accept + text/plain + + + + + stoptest diff --git a/testsuites/stability/src/main/resources/testplans/stability.jmx b/testsuites/stability/src/main/resources/testplans/stability.jmx old mode 100644 new mode 100755 index 09e0f65f9..5e4a64df6 --- a/testsuites/stability/src/main/resources/testplans/stability.jmx +++ b/testsuites/stability/src/main/resources/testplans/stability.jmx @@ -25,7 +25,7 @@ POLICY_PARTICIPANT_HOST_PORT - 20008 + 30008 = @@ -35,12 +35,19 @@ - http://${RUNTIME_HOST}:${RUNTIME_PORT}/onap/policy/clamp/acm/v2 + http://${RUNTIME_HOST}:${RUNTIME_PORT}/onap/policy/clamp/acm runtimeUser zb!XztG34 + + http://${POLICY_PARTICIPANT_HOST}:${POLICY_PARTICIPANT_HOST_PORT}/onap/policyparticipant + participantUser + zb!XztG34 + + + true false @@ -1684,17 +1691,9 @@ - true - - - - false - { - "primeOrder": "PRIME" -} - = - - + false + + ${RUNTIME_HOST} ${RUNTIME_PORT} @@ -2021,6 +2020,150 @@ vars.put("deployState", deployState); + + false + + + + ${RUNTIME_HOST} + ${RUNTIME_PORT} + http + /onap/policy/clamp/acm/prometheus + GET + true + false + true + false + false + false + false + 6 + false + 0 + + + + + 200 + + + Assertion.response_code + true + 33 + + + + groovy + + + true + def res = []; +if (prev.getResponseCode() == '200') { + res = prev.getResponseDataAsString(); + + assert res.contains("http_server_requests_seconds_sum") + assert res.contains("http_server_requests_seconds_max") + assert res.contains("spring_data_repository_invocations_seconds_count") + assert res.contains("spring_data_repository_invocations_seconds_sum") + assert res.contains("spring_data_repository_invocations_seconds_max") + assert res.contains("jvm_threads_live_threads") + + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"POST\",outcome=\"SUCCESS\",status=\"201\",uri=\"/v2/compositions\",}") + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"PUT\",outcome=\"SUCCESS\",status=\"202\",uri=\"/v2/compositions/{compositionId}\",}") + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"GET\",outcome=\"SUCCESS\",status=\"200\",uri=\"/v2/compositions/{compositionId}\",}") + + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"POST\",outcome=\"SUCCESS\",status=\"201\",uri=\"/v2/compositions/{compositionId}/instances\",}") + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"PUT\",outcome=\"SUCCESS\",status=\"202\",uri=\"/v2/compositions/{compositionId}/instances/{instanceId}\",}") + assert res.contains("http_server_requests_seconds_count{error=\"none\",exception=\"none\",method=\"GET\",outcome=\"SUCCESS\",status=\"200\",uri=\"/v2/compositions/{compositionId}/instances/{instanceId}\",}") + + assert res.contains("publisher_automation_composition_state_change_seconds_count") + assert res.contains("publisher_participant_update_seconds_count") + assert res.contains("publisher_participant_status_req_seconds_count") + assert res.contains("publisher_automation_composition_deploy_seconds_count") + + assert res.contains("listener_participant_prime_ack_seconds_count") + assert res.contains("listener_automation_composition_statechange_ack_seconds_count") + assert res.contains("listener_participant_status_seconds_count") +} + + + + + + Accept + text/plain + + + + + + + false + + + + ${POLICY_PARTICIPANT_HOST} + ${POLICY_PARTICIPANT_HOST_PORT} + http + /onap/policyparticipant/prometheus + GET + true + false + true + false + false + false + false + 6 + false + 0 + + + + + 200 + + + Assertion.response_code + true + 33 + + + + groovy + + + true + def res = []; +if (prev.getResponseCode() == '200') { + res = prev.getResponseDataAsString(); + + assert res.contains("http_server_requests_seconds_sum") + assert res.contains("http_server_requests_seconds_max") + assert res.contains("jvm_threads_live_threads") + + assert res.contains("publisher_participant_register_seconds_count") + assert res.contains("publisher_participant_prime_ack_seconds_count") + assert res.contains("publisher_participant_status_seconds_count") + assert res.contains("publisher_automation_composition_update_ack_seconds_count") + + assert res.contains("listener_participant_status_req_seconds_count") + assert res.contains("listener_participant_prime_seconds_count") + assert res.contains("listener_automation_composition_state_change_seconds_count") + assert res.contains("listener_automation_composition_update_seconds_count") +} + + + + + + Accept + text/plain + + + + + stoptest @@ -2178,6 +2321,10 @@ vars.put("deployState", deployState); 1 + + 6000 + + true @@ -2219,6 +2366,10 @@ vars.put("deployState", deployState); 1 + + 6000 + + ${__javaScript("${primeState}" !== "COMMISSIONED")} @@ -2342,7 +2493,7 @@ vars.put("deployState", deployState); true - /home/ramesh/run-test/testsummary.jtl + /tmp/testsummary.jtl @@ -2379,7 +2530,7 @@ vars.put("deployState", deployState); true - /home/ramesh/acm_stability/testsummary.jtl + /tmp/testsummary.jtl @@ -2416,7 +2567,7 @@ vars.put("deployState", deployState); true - /home/ramesh/./acm_stability/testsummary.jtl + /tmp/testsummary.jtl -- cgit 1.2.3-korg