GithubHelp home page GithubHelp logo

kunal732 / aws-codeguru-profiler-sample-application Goto Github PK

View Code? Open in Web Editor NEW

This project forked from r3-yamauchi/aws-codeguru-profiler-sample-application

1.0 2.0 2.0 16 KB

Code sample showing how to use Amazon CodeGuru Profiler Agent

License: MIT No Attribution

Java 100.00%

aws-codeguru-profiler-sample-application's Introduction

#Amazon CodeGuru Profiler Sample Application This package contains a simple Sales System application that creates and lists the orders created by the customers.

Before you begin

Create Profiling Group

  • 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

Create an EC2 instance to run this application on AWS

Prerequisites

  • Install Maven using instructions here
  • Install Java using instructions here
  • Install git using instructions here

Integrate the application with the CodeGuru Profiler

  • 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
      
  • 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.

License

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.