Add testcase for app metrics exposed by distribution 39/126739/1
authorRam Krishna Verma <ram_krishna.verma@bell.ca>
Mon, 24 Jan 2022 21:53:04 +0000 (16:53 -0500)
committerRam Krishna Verma <ram_krishna.verma@bell.ca>
Mon, 24 Jan 2022 21:53:12 +0000 (16:53 -0500)
Adding testcases to verify the application level
metrics exposed by policy-distribution component.

Issue-ID: POLICY-3759
Change-Id: I3cbc36011c358dc9f52aa01c663eb8ff02a6323a
Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
csit/distribution/tests/distribution-test.robot

index 8bf4b84..c283f66 100644 (file)
@@ -23,11 +23,27 @@ Metrics
     [Documentation]  Verify policy-distribution is exporting prometheus metrics
     ${hcauth}=  HealthCheckAuth
     ${resp}=  PerformGetRequest  ${POLICY_DISTRIBUTION_IP}  /metrics  200  null  ${hcauth}
-    Should Contain  ${resp.text}  jvm_threads_current
+    Should Contain  ${resp.text}  total_distribution_received_count_total 0.0
+    Should Contain  ${resp.text}  distribution_success_count_total 0.0
+    Should Contain  ${resp.text}  distribution_failure_count_total 0.0
+    Should Contain  ${resp.text}  total_download_received_count_total 0.0
+    Should Contain  ${resp.text}  download_success_count_total 0.0
+    Should Contain  ${resp.text}  download_failure_count_total 0.0
 
 InvokeDistributionAndRunEventOnEngine
     Wait Until Keyword Succeeds  5 min  30 sec  InvokeDistributionUsingFile And RunEventOnApexEngine
 
+MetricsAfterExecution
+    [Documentation]  Verify policy-distribution is exporting prometheus metrics after execution
+    ${hcauth}=  HealthCheckAuth
+    ${resp}=  PerformGetRequest  ${POLICY_DISTRIBUTION_IP}  /metrics  200  null  ${hcauth}
+    Should Contain  ${resp.text}  total_distribution_received_count_total 1.0
+    Should Contain  ${resp.text}  distribution_success_count_total 1.0
+    Should Contain  ${resp.text}  distribution_failure_count_total 0.0
+    Should Contain  ${resp.text}  total_download_received_count_total 1.0
+    Should Contain  ${resp.text}  download_success_count_total 1.0
+    Should Contain  ${resp.text}  download_failure_count_total 0.0
+
 *** Keywords ***
 
 InvokeDistributionUsingFile And RunEventOnApexEngine