All Projects → aws-samples → aws-codeguru-profiler-demo-application

aws-samples / aws-codeguru-profiler-demo-application

Licence: MIT-0 license
Example application demonstrating the features of Amazon CodeGuru Profiler

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to aws-codeguru-profiler-demo-application

nodeprof.js
Instrumentation framework for Node.js compliant to ECMAScript 2020 based on GraalVM.
Stars: ✭ 44 (+109.52%)
Mutual labels:  profiling
aws2openapi
Amazon Web Services API description to OpenAPI 3.0 definition
Stars: ✭ 45 (+114.29%)
Mutual labels:  amazon
observable-profiler
Tracks new & disposed Observable subscriptions
Stars: ✭ 41 (+95.24%)
Mutual labels:  profiling
iopipe-js
Build and run serverless apps with confidence on AWS Lambda with Tracing, Profiling, Metrics, Monitoring, and more.
Stars: ✭ 33 (+57.14%)
Mutual labels:  profiling
golden
a benchmark for compile-time and/or runtime Nim 🏆
Stars: ✭ 28 (+33.33%)
Mutual labels:  profiling
Selfhosted-Google-Photos-Alternative
A complete guide on exiting Google, Amazon or any proprietary service Photos storage with all the features you would want.
Stars: ✭ 143 (+580.95%)
Mutual labels:  amazon
google-aws-federator
A small command line tool to help manage AWS Federated Identities authenticated through Google Apps
Stars: ✭ 29 (+38.1%)
Mutual labels:  amazon
amazon-ec2-image-builder-samples
Samples for Amazon EC2 Image Builder
Stars: ✭ 103 (+390.48%)
Mutual labels:  amazon
amazon wishlist pricewatch
Periodically check your public Amazon wishlist for price reductions.
Stars: ✭ 22 (+4.76%)
Mutual labels:  amazon
ghc-stack
Hacking GHC's Stack for Fun and Profit (featuring The Glorious Haskell Debugger v0.0.1 Pre-alpha)
Stars: ✭ 69 (+228.57%)
Mutual labels:  profiling
selling-partner-api-sdk
Golang toolkit for working with Amazon's Selling Partner API (SP-API)
Stars: ✭ 48 (+128.57%)
Mutual labels:  amazon
Holly-Quintet
A web app used for searching disks' covers from a series of music websites.
Stars: ✭ 22 (+4.76%)
Mutual labels:  amazon
affiliate
Add affiliation tags to links automatically in the browser
Stars: ✭ 77 (+266.67%)
Mutual labels:  amazon
profiler
Continuous profiling based on pprof
Stars: ✭ 221 (+952.38%)
Mutual labels:  profiling
PHPench
Realtime benchmarks for PHP code
Stars: ✭ 53 (+152.38%)
Mutual labels:  profiling
agw
Route AWS APIGateway to lambda with standard router such as mux
Stars: ✭ 24 (+14.29%)
Mutual labels:  amazon
Amazon-Price-Alert
Price tracker of Amazon
Stars: ✭ 83 (+295.24%)
Mutual labels:  amazon
android device amazon karnak
Android device tree for the Amazon Fire HD8 2018
Stars: ✭ 38 (+80.95%)
Mutual labels:  amazon
aws-ses-sns-dashboard
Dashboard for AWS SES notifications
Stars: ✭ 25 (+19.05%)
Mutual labels:  amazon
jstackSeries.sh
Script for capturing a series of thread dumps from a Java process using jstack (on Linux and Windows)
Stars: ✭ 28 (+33.33%)
Mutual labels:  profiling

Amazon CodeGuru Profiler demo application

Simple application for demonstrating the features of Amazon CodeGuru Profiler.

CodeGuru Profiler Console Screenshot

Quick demo

The results of this app are available to play with in the AWS console. There is no need to run the code, if you just want to see the results.

  1. Sign into the AWS console
  2. Head to CodeGuru Profiler and check out the demo app

How it works

The application does some basic image processing, with some CPU-heavy operations alongside some IO-heavy operations.

It consists chiefly of two components which run in parallel, the task publisher and the image processor.

CodeGuru Profiler runs inside the application, in the same way any real application would use it. It collects and reports profiling data about the application, ready to be viewed in the AWS console.

TaskPublisher

Checks the S3 bucket for available images, and submits the name of some of these images to the SQS queue.

ImageProcessor

Polls SQS for names of images to process. Processing an image involves downloading it from S3, applying some image transforms (e.g. converting to monochrome), and uploading the result back to S3.

Setup

Make sure you have installed the latest version of AWS CLI.

Setup the required components by running the following aws commands:

  1. Create two profiling groups in CodeGuru Profiler, named DemoApplication-WithIssues and DemoApplication-WithoutIssues
  2. Create an SQS queue
  3. Create an S3 bucket
  4. Install Maven (to build and run the code).
  5. Create/use an IAM role with permissions to access SQS, S3 and CodeGuru Profiler
aws configure # Set up your AWS credentials and region as usual
aws codeguruprofiler create-profiling-group --profiling-group-name DemoApplication-WithIssues
aws codeguruprofiler create-profiling-group --profiling-group-name DemoApplication-WithoutIssues
aws s3 mb s3://demo-application-test-bucket-1092734-REPLACE-ME
aws sqs create-queue --queue-name DemoApplicationQueue

How to run

The demo application can be run in two modes: with-issues and without-issues. Thus, you can compare how an optimized version of the application compares to one with performance issues.

  • To run the with-issues version, use the following instructions. Remember to replace YOUR-ACCOUNT-ID, YOUR-AWS-REGION and YOUR-BUCKET-REPLACE-ME as appropriate.
# These need to be set according to your setup:
export DEMO_APP_SQS_URL=https://sqs.YOUR-AWS-REGION.amazonaws.com/YOUR-ACCOUNT-ID/DemoApplicationQueue
export DEMO_APP_BUCKET_NAME=demo-application-test-bucket-1092734-YOUR-BUCKET-REPLACE-ME
export AWS_CODEGURU_TARGET_REGION=YOUR-AWS-REGION

# Run the demo!
export AWS_CODEGURU_PROFILER_GROUP_NAME=DemoApplication-WithIssues
mvn clean install # generates the DemoApplication-1.0-jar-with-dependencies.jar
java -javaagent:codeguru-profiler-java-agent-standalone-1.2.2.jar \
  -jar target/DemoApplication-1.0-jar-with-dependencies.jar with-issues
  • To run the without-issues version, use the following instructions. Remember to replace YOUR-ACCOUNT-ID, YOUR-AWS-REGION and YOUR-BUCKET-REPLACE-ME as appropriate.
# These need to be set according to your setup:
export DEMO_APP_SQS_URL=https://sqs.YOUR-AWS-REGION.amazonaws.com/YOUR-ACCOUNT-ID/DemoApplicationQueue
export DEMO_APP_BUCKET_NAME=demo-application-test-bucket-1092734-YOUR-BUCKET-REPLACE-ME
export AWS_CODEGURU_TARGET_REGION=YOUR-AWS-REGION

# Run the demo!
export AWS_CODEGURU_PROFILER_GROUP_NAME=DemoApplication-WithoutIssues
mvn clean install # generates the DemoApplication-1.0-jar-with-dependencies.jar
java -javaagent:codeguru-profiler-java-agent-standalone-1.2.2.jar \
  -jar target/DemoApplication-1.0-jar-with-dependencies.jar without-issues

Run this for a few hours to get plenty of data, along with a recommendations report.

Note: When running with-issues, you'll see plenty of Expensive exception, Pointless work and other debug gibberish being logged. This is expected! This is an example of a badly coded application, and you'll be able to see how these issues show up on the CodeGuru Profiler console.

So don't worry 😎 -- we totally know about it.

License

This code is licensed under the MIT-0 License. See the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].