#Amazon CodeGuru Profiler Sample Application This package contains a simple Sales System application that creates and lists the orders created by the customers.
- Go to the CodeGuru Profiler console
- Click “Create Profiling Group”
- In the text box, provide a name for your profiling group
- Click “Create a profiling group”
- Follow the instructions on the next page to add permissions for the roles/users being used by the Agent
- Install Maven using instructions here
- Install Java using instructions here
- Install git using instructions here
- git clone https://github.com/aws-samples/aws-codeguru-profiler-sample-application.git
- Navigate to the root directory
cd aws-codeguru-profiler-sample-application
- Change the line number 36 (shown below) on file
src/main/java/com/company/sample/application/SalesSystem.java
to submit profiling data the profiling group just created.Profiler.builder().profilingGroupName("<Insert the profiling group name here>")
- Build the package
mvn package
- Run the application
- If using EC2 instance profile role
mvn exec:java -Dexec.mainClass=com.company.sample.application.SalesSystem
- If not using EC2 instance profile role, pass the credentials as environment variables before running the application
export AWS_ACCESS_KEY_ID=<AccessKeyId> export AWS_SECRET_ACCESS_KEY=<SecretAccessKey> mvn exec:java -Dexec.mainClass=com.company.sample.application.SalesSystem
- If using EC2 instance profile role
- A few seconds after the program is started you should see the following message on the standard output:
INFO: Profiling scheduled, sampling rate is PT1S
- After 5 to 10 minutes you should see the following message denoting a successful report of profiling data.
INFO: Successfully reported profile
- Go to the Amazon CodeGuru Profiler Console and click your profiling group in order to see the profiling data.
This library is licensed under the MIT-0 License. See the LICENSE file.