Skip to content

Instantly share code, notes, and snippets.

@mgreen
mgreen / rpm_instrumentation.rb
Created March 21, 2012 00:43
newrelic for em-http-request with em-synchrony
if defined?(::EM::HTTPMethods) and defined?(::EM::Synchrony)
module EM::HTTPMethods
def request_with_newrelic_trace(type, *args, &block)
uri = @uri.kind_of?(Addressable::URI) ? @uri : Addressable::URI::parse(@uri.to_s)
metrics = ["External/#{uri.host}/EM::HTTPMethods/#{type.to_s.upcase}","External/#{uri.host}/a
ll"]
if NewRelic::Agent::Instrumentation::MetricFrame.recording_web_transaction?
metrics << "External/allWeb"
else
@mgreen
mgreen / ctags_vim_paths_gemfile.rb
Created June 24, 2011 18:07 — forked from andyl/ctags_vim_paths_gemfile.rb
Generates Ctags and Vim Paths from Gemfile.lock respecting in/excluded groups
#!/usr/bin/ruby
require 'rubygems'
require 'bundler'
=begin
This script was written to incorporate Bundler and Gemfile.lock into
Vim's tag and file-finding tools.
=end
# This code generates ctags. If a Gemfile.lock is found