X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=policy-agent%2Fsrc%2Ftest%2Fjava%2Forg%2Foransc%2Fpolicyagent%2FConcurrencyTestRunnable.java;h=2d57e52af9c1530f3a6ff091f4e41132edca794f;hb=ba50f8809edc7d49a74021e25b4094f4c3174b26;hp=f8f7ca3b49194d64cca68ba434cc04101285f1f7;hpb=e2a037745508a3c1ada650ea3571ca57f0a90851;p=nonrtric.git diff --git a/policy-agent/src/test/java/org/oransc/policyagent/ConcurrencyTestRunnable.java b/policy-agent/src/test/java/org/oransc/policyagent/ConcurrencyTestRunnable.java index f8f7ca3b..2d57e52a 100644 --- a/policy-agent/src/test/java/org/oransc/policyagent/ConcurrencyTestRunnable.java +++ b/policy-agent/src/test/java/org/oransc/policyagent/ConcurrencyTestRunnable.java @@ -34,6 +34,7 @@ import org.oransc.policyagent.utils.MockA1Client; import org.oransc.policyagent.utils.MockA1ClientFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.http.ResponseEntity; /** * Invoke operations over the NBI and start synchronizations in a separate @@ -59,11 +60,26 @@ class ConcurrencyTestRunnable implements Runnable { this.webClient = new AsyncRestClient(baseUrl); } + private void printStatusInfo() { + try { + String url = "/actuator/metrics/jvm.threads.live"; + ResponseEntity result = webClient.getForEntity(url).block(); + System.out.println(Thread.currentThread() + result.getBody()); + + url = "/rics"; + result = webClient.getForEntity(url).block(); + System.out.println(Thread.currentThread() + result.getBody()); + + } catch (Exception e) { + logger.error(Thread.currentThread() + "Concurrency test printStatusInfo exception " + e.toString()); + } + } + @Override public void run() { try { - for (int i = 0; i < 100; ++i) { - if (i % 10 == 0) { + for (int i = 0; i < 500; ++i) { + if (i % 100 == 0) { createInconsistency(); this.supervision.checkAllRics(); } @@ -77,6 +93,7 @@ class ConcurrencyTestRunnable implements Runnable { } } catch (Exception e) { logger.error("Concurrency test exception " + e.toString()); + printStatusInfo(); } } @@ -90,6 +107,7 @@ class ConcurrencyTestRunnable implements Runnable { .ric(ric) // .ownerServiceName("") // .lastModified("") // + .isTransient(false) // .build(); }