Perfana demo

Table of contents

  1. Demo environment
  2. Prerequisites
  3. Getting started
  4. Exploring the demo environment
  5. Start a test
  6. View test runs in Perfana
  7. Alerts

Demo environment

The Perfana demo environment can be used to try out all the features. It uses Docker compose and has a all components to emulate a live-like environment for Perfana, including an application to run a performance test.

Prerequisites

Getting started

  • Clone perfana-demo repository
    git clone https://github.com/perfana/perfana-demo.git
    

    or download here

    If you use the download option, make sure to extract the zip to a directory named perfana-demo!

  • Add this to your hosts file
    127.0.1.1  perfana
    127.0.1.1  jenkins  
    127.0.1.1  grafana
    
  • Inside the repository root run
    ./start.sh
    

This spins up a number of containers

ContainerDescriptionexposed to local port
perfanaPerfana front end4000
perfana-grafanaPerfana - Grafana integration servicen/a
perfana-snapshotPerfana snapshot servicen/a
perfana-checkPerfana results check servicen/a
perfana-fixtureLoads fixture datan/a
perfana-jenkinsJenkins with two performance test jobs pre-configured8080
mongodbMongoDb replicaset to store Perfana configuration27011 / 27012 /27013
grafanaGrafana graphing dashboard3000
influxdbInfluxDb metrics datastore8086 / 2003
telegrafTelegraf metrics agentn/a
prometheusPrometheus metrics datastore9090
alertmanagerAlertmanager handles alerts from Prometheus9093
optimus-prime-feSpringboot test application8090
optimus-prime-beSpringboot test applicationn/a
mariadbDatabase used by test applicationn/a
jaegerDistributed tracing16686
omnidbOnline database management tool8888
logstashLogstash for parsing logsn/a
elasticsearchLogs storage / serarch enginen/a
kibanaKibana Elasticsearch UI5601
wiremockMocking tool8060

To stop all containers, run

./stop.sh

To remove all containers, use

./clean.sh

When you use the clean.sh script, all of the data inside the containers will be lost!


To start, stop or remove containers individually use docker-compose and the service name as used in the docker-compose.yml file, e.g. when a newer version of the perfana image is available

docker-compose stop perfana && docker-compose rm -f perfana && docker-compose up -d perfana

The perfana-demo repository is updated frequently, so to get the latest and greatest pull repo and images.

git pull && docker-compose pull

Exploring the demo environment

Perfana

To log into Perfana, open http://localhost:4000 and use admin@perfana.io as user with password perfana. If you want to log in as a non-admin user, you can try users daniel@perfana.io or dylan@perfana.io, both with password perfana

Jenkins

To log into Jenkins, open http://localhost:8080 and use perfana as user with password perfana

Grafana

To log into Grafana, open http://localhost:3000 and use perfana as user with password perfana

Start a test

The Perfana demo environment comes with a Jenkins instance preconfigured with a job that will trigger a Gatling script to execute a load test on two instances of Afterburner, a Spring Boot test application, deployed as optimus-prime-fe and optimus-prime-be. The job checks out the perfana-gatling-afterburner repository and triggers the test via the events-gatling-maven-plugin. When the job is started, this plugin sends meta data for the test, as specified in the pom.xml, to Perfana.

To start a test, go to http://localhost:8080, click on the OptimusPrime job and click Build with parameters. The following parameters can be set:

  • system_under_test: Use this parameter to set the System Under Test property in Perfana. Default is set to OptimusPrime
  • gatlingRepo: Repository containing the Gatling script. By default the job is using https://github.com/perfana/perfana-gatling-afterburner/tree/OptimusPrime
  • workload: Workload to use in the test, corresponds to the workload profiles in the pom.xml
  • annotation: Can be used to add some annotation to the test run.

The demo contains three workload examples to demonstrate some use cases for Perfana:

  • load test: a steady state load on OptimusPrime. Run this workload a few times to view the automatic analysis feature in action, that can be used as quality gate in a CI/CD setup.
  • stress test: an increasing load on OptimusPrime, until the test is automatically terminated when the system under test reaches a specified condition. Demonstrates the use of abort alert tags
  • slow back end test: a steady state load on OptimusPrime. A wiremock stub is configured to emulate a back end service for OptimusPrime. The test-events-wiremock plugin is used to increase the response times of the stub during the test. This test can be used to test the resilience of a system under test.

When the job has started, open the console log to see the events-gatling-maven-plugin is building and executing the test.


Note: when the job is running for the first time it will take some time to start up because Maven has to download all dependencies. Check the build log via Console Output to see the progress.


View test runs in Perfana

To have a look at the test results in Perfana open http://localhost:4000 and use admin@perfana.io as user with password perfana to log in.

In the home page click on Afterburner under Your systems under test. In the Running tests section you will see the test you have just triggered.

Running test

Click here to learn more about the Running tests section.

When the test has finished the test run is displayed in the Recent runs section and a number of events are triggered:

  • Perfana creates snapshots for all of the Grafana dashboards linked to the test run.
  • Perfana evaluates all Service Level Objectives (read here how to configure) and compares thresholds for the Service Level Indicators of the test run. After the evaluation the consolidated results are displayed in the Results column.

Click here to learn more about the Recent runs section.

If more than one test run is available for a specific set of test run properties, a Trends tab becomes visible. In this tab you can view trends over time for the specified Service Level Indicators. Read more on trends

View test run details

To view more details for the test run you can click on the test run ID. The test run details view has a number of tabs:

Summary

Comments

Service Level Indicators

Dashboards

Report

Compare

Jaeger

Manage

Alerts

In the demo environment three Alertmanager alerts are defined, as you can see in the Prometheus UI.

These alert rules can be found in the prometheus.rules.yml file in the perfana-demo repo

In alertmanager.yml Perfana has been set up as receiver

The Afterburner test application has been set up to expose JVM metrics via actuator and two metric tags have been added system_under_test and test_environment.

If one of the alerts is triggered, Perfana tries to map alert metric tags to properties of any running test. If it finds a match, it will create an annotation for all linked Grafana dashboards in each graph. This can help you track down root causes for bottleneck in your test runs.

Learn more on alerts here


Copyright © 2019-2024 Perfana Software BV