Dtracy, or How To Soon Spot Trends in your Web Application and Server
Dtracy is part of the Ruby on Rail's Google Summer of Code '09 Quartet, with development updates and entertainment available at
http://ecin.tumblr.com Welcome! Sit down, grab a sugary drink, and enjoy the smell of freshly baked code right out of the oven.
An operating system with support for Dtrace (http://www.sun.com/bigadmin/content/dtrace/) is a must. Mac OS X, Solaris/OpenSolaris and FreeBSD are all acceptable choices, though you're hardcore if you get Dtrace running properly on FreeBSD.
A courageous heart will also come in handy: this is still alpha software.
- rack-contrib ( for Rack::JSONP )
- ruby-dtrace ( I suggest grabbing the latest from http://github.com/chrisa/ruby-dtrace/ )
The running process will require root privileges in order to access the Dtrace probes. As such,
sudo bin/server will run
examples/dtracy.ru as a rackup file on port 3000.
hello world - a brief overview
Actually, I don't mean to be pretentious. "hello 4 or 5 curious developers" is a better name for this section.
Digression aside, Dtracy is divided into two areas:
Dtracy::App. They're both written as Rack middleware to allow easy dropping into other apps, with
Rack::Probe handling the definition and consumption of Dtrace probes while
Dtracy::App is meant to provide visualizations to the data generated from the aforementioned probes.
Dtracy::App app gets loaded, providing a list of activated probes and an inconspicuous ring at
/__dtracy__/. Requests made to the server will fire the
rack*:ruby:path:path probe setup in
examples/dtracy.ru. In short:
- Point a browser at
- Drag and drop the
rack*:ruby:path:pathdiv/string onto the ring; it should start spinning
curl localhost:3000/[any path]several times
- Watch the ring spin faster; this is due to the probe firing for each request made
ab -n100 http://127.0.0.1:3000/[any path]if you feel like hosing the application
Feel free to visit
/__dtracy__/updates to see what kind of JSON data gets generated by the active probes.