https://github.com/ryandotsmith/unicorn-instruments
Instrument latency as close to the syscall as possible
https://github.com/ryandotsmith/unicorn-instruments
Last synced: about 1 month ago
JSON representation
Instrument latency as close to the syscall as possible
- Host: GitHub
- URL: https://github.com/ryandotsmith/unicorn-instruments
- Owner: ryandotsmith
- Created: 2013-03-14T20:11:06.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-04T22:03:51.000Z (over 12 years ago)
- Last Synced: 2025-06-03T03:44:04.091Z (about 1 month ago)
- Language: Ruby
- Size: 117 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# unicorn-instruments
This is a hack in order to account for the total time spent in ruby while processing http requests.
## Usage
```ruby
gem 'unicorn-instruments'
```Require the gem in your unincorn config file.
config/unicorn.rb
```ruby
require 'unicorn-instruments'
...
```## Synopsis
```
Start a timer.
Call accept().
Call send().
Close socket.
Stop timer.
Print Elapsed time.
```If the timer elapsed for 4ms, the following log line will be printed:
```
measure=unicorn.process val=4
```Using this data with [l2met](https://github.com/ryandotsmith/l2met) you can plot the unicorn processing time with the router service time. The difference between the values will be the time spent in the Heroku network.
