Giter VIP home page Giter VIP logo

rack-request-profiler's Introduction

Build Status

This project provides a simple "framework" for profiling request / response times, and sending the data to another service. It includes a base class Rack::RequestProfiler for handling the logic of wrapping and timing the request / response cycle in a rack app.

By default, the Rack::RequestProfiler middleware does not do anything with the profiling data. Instead, this logic must be implemented by subclasses by defining the handle_results instance method. For example, you might send profiling data to an external web service (stathat, papertrail, loggly, etc), statsd, write to a logfile on disk, put it in a persistent store like redis or mongo, or really anything else your heart desires.

This project currently provides profiler middlewares for stathat and statsd. If you'd like to contribute a profiler middleware, pull requests are welcome.

Installation

gem install rack-request_profiler

Usage

Simply include one of the profiler middlewares into the middleware stack in any rack-compatible application like so:

$statsd = Statsd.new('localhost')
use Rack::Profilers::Statsd, $statsd, :ignore_path => /^\/assets/

Be default, we match URL's that look like BSON ids. You can over-ride this regular expression like this:

Rack::Utils::UrlStripper.id_pattern = /some_other_pattern/

Profilers

  • Statsd - Uses the statsd ruby client to send data to statsd / graphite.
  • Stathat - Uses the em-stathat gem to send data to stathat asynchronously via eventmachine.

rack-request-profiler's People

Contributors

ajsharp avatar

Stargazers

Michael Lopez avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

rack-request-profiler's Issues

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.