integration-tests/src/test/java/oracle/kubernetes/operator/ItMonitoringExporter.java
private static void verifyScalingViaPrometheus(Domain domain, String webappName)
      throws Exception {

    createWebHookForScale();
    // scale cluster to only one replica
    scaleCluster(1);
    // invoke the app to increase number of the opened sessions
    String testAppName = "httpsessionreptestapp";


    domain.callWebAppAndVerifyLoadBalancing(testAppName + "/CounterServlet?", false);

    String webhookPod = getPodName("name=webhook", "monitoring");
    String command = "kubectl -n " + monitoringNS + " logs " + webhookPod;
    TestUtils.checkAnyCmdInLoop(command, "scaleup hook triggered successfully");

    TestUtils.checkPodCreated(domain.getDomainUid() + "-managed-server2", domain.getDomainNs());
  }
/**
   * Deploy Monitoring Exporter webapp, Prometheus and Grafana.
   *
   * @param webappName webapp name used to collect metrics for scaling
   * @param domain     - domain where monitoring exporter will be deployed
   * @throws Exception if could not run the command successfully
   */
Deploy Monitoring Exporter webapp, Prometheus and Grafana.
@param webappName webapp name used to collect metrics for scaling
@param domain     - domain where monitoring exporter will be deployed
@throws Exception if could not run the command successfully
Deploy Monitoring Exporter webapp Prometheus and Grafana . @param webappName webapp name used to collect metrics for scaling @param domain - domain where monitoring exporter will be deployed @throws Exception if could not run the command successfully
private static void verifyScalingViaPrometheus(Domain domain, String webappName)
      throws Exception {
    createWebHookForScale();
    scaleCluster(1);
    String testAppName = "httpsessionreptestapp";
    domain.callWebAppAndVerifyLoadBalancing(testAppName + "/CounterServlet?", false);
    String webhookPod = getPodName("name=webhook", "monitoring");
    String command = "kubectl -n " + monitoringNS + " logs " + webhookPod;
    TestUtils.checkAnyCmdInLoop(command, "scaleup hook triggered successfully");
    TestUtils.checkPodCreated(domain.getDomainUid() + "-managed-server2", domain.getDomainNs());
  }
private static void verifyScalingViaPrometheus ( Domain domain , String webappName ) throws Exception { createWebHookForScale ( ) ; scaleCluster ( 1 ) ; String testAppName = "httpsessionreptestapp" ; domain . callWebAppAndVerifyLoadBalancing ( testAppName + "/CounterServlet?" , false ) ; String webhookPod = getPodName ( "name=webhook" , "monitoring" ) ; String command = "kubectl -n " + monitoringNS + " logs " + webhookPod ; TestUtils . checkAnyCmdInLoop ( command , "scaleup hook triggered successfully" ) ; TestUtils . checkPodCreated ( domain . getDomainUid ( ) + "-managed-server2" , domain . getDomainNs ( ) ) ; }
Deploy Monitoring Exporter webapp, Prometheus and Grafana.
Deploy Monitoring Exporter webapp Prometheus and Grafana .
// scale cluster to only one replica // invoke the app to increase number of the opened sessions