...
- Single Node Kubernetes cluster environment (e.g. microk8s)
- Prometheus service up and running (https://linuxacademy.com/blog/kubernetes/running-prometheus-on-kubernetes/)
- Grafana dashboard up and running
...
Expand |
---|
|
trust.pass trust.jks.b64 jks.pass cert.jks.b64 Code Block |
---|
| apiVersion: apps/v1
kind: Deployment
metadata:
name: pmmapper
spec:
selector:
matchLabels:
run: pmmapper
replicas: 1
template:
metadata:
labels:
run: pmmapper
spec:
containers:
- name: pmmapper
image: iamaim/pmmapper:1.0.0
env:
- name: CONFIG_BINDING_SERVICE_SERVICE_HOST
value: $(SIMULATOR_SERVICE_HOST)
- name: CONFIG_BINDING_SERVICE_SERVICE_PORT
value: $(SIMULATOR_SERVICE_PORT)
- name: HOSTNAME
value: "pm-mapper"
ports:
- containerPort: 8081
volumeMounts:
- name: config-volume
mountPath: /opt/app/pm-mapper/etc/cert/PM Mapper initial performance metrics
volumes:
- name: config-volume
configMap:
name: pmmapper-config
|
Code Block |
---|
language | js |
---|
title | metadata.json |
---|
| {"productName": "ACME_Node","vendorName": "ACME Corp","lastEpochMicrosec": "1538478000000","sourceName": "some source","startEpochMicrosec": "1538478900000","timeZoneOffset": "UTC+01:00","location": "ftpes://somelocation:22/ftp/rop/somefile.xml.gz","compression": "gzip","fileFormatType": "org.3GPP.32.435#measCollec","fileFormatVersion": "V9"} |
Code Block |
---|
language | bash |
---|
title | testmapperperformance.sh |
---|
| #!/bin/bash
rm ~/perfresults
LOOPCOUNT=$1
for i in $(seq 1 $LOOPCOUNT)
do
START=$(date +%s)
echo "Performance test run#$i(of $LOOPCOUNT)"
python3 ~/delivery.py -w 10 -n 750 -r -i -H "X-DMAAP-DR-PUBLISH-ID:1" -H "X-DMAAP-DR-META:@metadata.json" -d @APM.xml -m put http://127.0.0.1:31196/delivery/APM.xml -v
END=$(date +%s)
secs=$(expr $END - $START)
echo $secs >> ~/perfresults
if (($i < $LOOPCOUNT));then
echo "Finished performance test run#$i(of $LOOPCOUNT), resting for a bit.."
#sleep 13
fi
done
echo $(awk '{s+=$1} END {print s/NR}' ~/perfresults | awk '{print int($1+0.5)}') >> ~/perftotaltime
TOTAL=$(tail -n 1 ~/perftotaltime)
TOTALTIME=$(printf '%dh:%dm:%ds\n' $(($TOTAL/3600)) $(($TOTAL%3600/60)) $(($TOTAL%60)))
echo "Average time($LOOPCOUNT runs)is: $TOTALTIME"
|
|
1.Deploy the simulator.
kubectl run simulator image=iamaim/simulator-perf:1.0.0 --replicas=1 --port=8888
kubectl expose deployment simulator --type=NodePort --port=8888 --target-port=8888 --name=simulator
...
kubectl expose deployment pmmapper --type=NodePort --port=8081 --target-port=8081 --name=pmmapper
3.Run testmapperperformance.sh
Code Block |
---|
|
. ~/testmapperperformance.sh <loop count>
e.g. . ~/testmapperperformance.sh 10 |
View your Grafana Dashboard and fine tune the view to get the cpu/memory and other useful metrics for the pmmapper pod.
...