yurake/k8s-3tier-webapp

View on GitHub
kubernetes/monitoring/jenkins/init/jobs/test.ab.k8s-3tier-webapp/config.xml

Summary

Maintainability
Test Coverage
<?xml version='1.1' encoding='UTF-8'?>
<project>
  <actions />
  <description></description>
  <keepDependencies>false</keepDependencies>
  <properties>
    <hudson.model.ParametersDefinitionProperty>
      <parameterDefinitions>
        <hudson.model.ChoiceParameterDefinition>
          <name>SERVICE</name>
          <description>target service</description>
          <choices class="java.util.Arrays$ArrayList">
            <a class="string-array">
              <string></string>
              <string>activemq</string>
              <string>rabbitmq</string>
              <string>hazelcast</string>
              <string>redis</string>
              <string>kafka</string>
            </a>
          </choices>
        </hudson.model.ChoiceParameterDefinition>
      </parameterDefinitions>
    </hudson.model.ParametersDefinitionProperty>
  </properties>
  <scm class="hudson.plugins.git.GitSCM" plugin="git@4.4.5">
    <configVersion>2</configVersion>
    <userRemoteConfigs>
      <hudson.plugins.git.UserRemoteConfig>
        <url>https://github.com/yurake/k8s-3tier-webapp</url>
      </hudson.plugins.git.UserRemoteConfig>
    </userRemoteConfigs>
    <branches>
      <hudson.plugins.git.BranchSpec>
        <name>*/master</name>
      </hudson.plugins.git.BranchSpec>
    </branches>
    <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
    <submoduleCfg class="list" />
    <extensions />
  </scm>
  <canRoam>true</canRoam>
  <disabled>false</disabled>
  <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
  <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
  <triggers />
  <concurrentBuild>true</concurrentBuild>
  <builders>
    <hudson.tasks.Shell>
      <command>#!/bin/sh -x
cd kubernetes/monitoring/test/ab
kubectl apply -f ab-${SERVICE}-job.yaml
kubectl -n monitoring wait --for=condition=complete --timeout=600s job/ab-${SERVICE}
kubectl -n monitoring describe job ab-${SERVICE}
kubectl -n monitoring logs -f $(kubectl get pods -n monitoring | awk &apos;{print $1}&apos; | grep ab-${SERVICE})
kubectl -n monitoring logs -f $(kubectl get pods -n monitoring | awk &apos;{print $1}&apos; | grep ab-${SERVICE}) &gt; ../../../../out.data
kubectl delete -f ab-${SERVICE}-job.yaml
</command>
      <configuredLocalRules />
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
      <command>cat &gt; apache-benchmark.p &lt;&lt; &quot;EOF&quot;
# output as png image
set terminal png

# save file to &quot;benchmark.png&quot;
set output &quot;benchmark-SERVICE-DATE.png&quot;

# graph title
set title &quot;ab -n 100 -c 10 http://k8s.3tier.webapp/quarkus/SERVICE/publish&quot;

#nicer aspect ratio for image size
set size 1,0.7

# y-axis grid
set grid y

#x-axis label
set xlabel &quot;request&quot;

#y-axis label
set ylabel &quot;response time (ms)&quot;

#plot data from &quot;out.data&quot; using column 9 with smooth sbezier lines
plot &quot;out.data&quot; using 9 smooth sbezier with lines title &quot;something&quot;</command>
      <configuredLocalRules />
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
      <command>sed -i -n &apos;/starttime/,$p&apos; out.data

DATE=`date &quot;+%Y%m%d-%H%M%S&quot;`
sed -i -e &quot;s/SERVICE/${SERVICE}/g&quot; apache-benchmark.p
sed -i -e &quot;s/DATE/${DATE}/g&quot; apache-benchmark.p

gnuplot apache-benchmark.p</command>
      <configuredLocalRules />
    </hudson.tasks.Shell>
    <hudson.tasks.Shell>
      <command>find ${WORKSPACE} -name &quot;benchmark-*.png&quot; -mtime +3 -exec rm {} \;</command>
      <configuredLocalRules />
    </hudson.tasks.Shell>
  </builders>
  <publishers />
  <buildWrappers>
    <org.csanchez.jenkins.plugins.kubernetes.KubectlBuildWrapper plugin="kubernetes@1.27.3">
      <serverUrl>https://kubernetes.default.svc.cluster.local</serverUrl>
      <credentialsId>1fd27e80-81ad-45be-a952-fe5e0d217074</credentialsId>
    </org.csanchez.jenkins.plugins.kubernetes.KubectlBuildWrapper>
  </buildWrappers>
</project>