Giter VIP home page Giter VIP logo

metrics-example's Introduction

Metrics Example with Spring Boot

This code base is an example of using CodaHale Metrics (fka Yammer Metrics) [http://metrics.codahale.com] and Spring Boot [http://projects.spring.io/spring-boot/].

Running the Example

  1. Clone or fork the repository locally
  2. Run gradlew runJar on *nix/Mac or gradlew.bat runJar on Windows
  3. Open browser to http://localhost:8080/test/api

About the Example

This uses Spring Boot to bootstrap the Web Application using embedded Jetty. This happens in the com.sample.metrics.Application class. This class also contains the @EnableMetrics annotation used to enable the Metrics plugin for Spring. We also expose the MetricRegistry using a variety of other plugins and configure it using a JMX reporter. Using this plugin we can now simply add @Timed to any public Spring bean method and automatically create a timer that wraps the method. The RestProvider and TestController provide examples of this. The RestProvider is used with an InstrumentedHttpClient to automatically instrument the Apache HTTP Client used to fetch API responses. The TestController is a simple Spring MVC endpoint to test everything.

metrics-example's People

Watchers

 avatar

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.