Skip to content
Project for performance training
JavaScript Java
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
jamon-monitor
jmeter-client
stock-trade
.gitignore
README.textile
mock.PNG
pom.xml
sukyky.iml
sukyky.ipr

README.textile

Sukyky

Open source J2EE performance training project implemented with Spring MVC.

Setting up

1) Clone
git clone git@github.com:huljas/sukyky.git
2) Build
cd sukyky
mvn install
3) Configure database

You will need a MySQL Community Server, download it here

vi stock-trade/src/main/resources/database.properties
4) Create database
cd stock-trade
mvn db-migration:drop db-migration:create db-migration:migrate
5) Run
mvn jetty:run
...
[INFO] Started Jetty Server

Generates test data on the first run so please be patient ;).

6) Open web browser
http://localhost:8080/

Well this will take a while …

7) Start JMeter
cd ../jmeter-client
ant jmeter

Downloads and starts JMeter.

Tools

JMeter test client

JMeter

Jmeter-plugins

Starting up

cd jmeter-client
ant jmeter

This installs and starts the client.

Next select File – Open and open the file in

jmeter-client/src/test/jmeter/Basic.xml

Jamon monitoring API

Jamon Api

Collecting data

The data can be collected with the following code:

Monitor monitor = MonitorFactory.start("Label name");
try {
// code to monitor
} finally {
  monitor.stop();
}

To simplify the jamon-monitor project contains a @Jamon annotation which can be used to mark a class or method for monitoring.

Monitoring

The example application comes with a Jamon admin page in address:

http://localhost:8080/jamon/admin

Java SE tools

jconsole

Java monitoring and management console

jmap

Memory map

Checking heap histogram

jmat -histo:live <pid>

Exercises

General tips:

  • Measure, don’t guess
  • Use @Jamon annotation to get better understanding of the problem
  • Measure again after each change

1. Slow front page

Find out why the loading the front page takes so long and fix it.

Goal: Front page response time less than 100ms.

2. No throughput

Find out why the throughput doesn’t increase as the number of threads increases and fix it.

Goal: Throughput of front page and stock page over 500req/s.

3. Stability

Site has had some stability problems in production. See if you can find out the cause.

Something went wrong with that request. Please try again.