This code is no longer needed. Heroku has provided syslog drains for all users for free.
For better Heroku logging with Papertrail, check this out:
http://help.papertrailapp.com/kb/hosting-services/heroku#standalone
| from riak import RiakError | |
| class Bucket(object): | |
| """Wrap up retries and conflict resolution""" | |
| def __init__(self, client, name, resolve, retries=5): | |
| self.client = client | |
| self.name = name | |
| self.bucket = client.bucket(name) # base bucket | |
| self.resolve = resolve | |
| self.retries = retries |
| module Test | |
| module Unit | |
| TestCase = RSpec::Core::ExampleGroup | |
| end | |
| end | |
| class Test::Unit::TestCase | |
| def self.inherited(host) | |
| host.set_it_up host.name.gsub(/(Spec|Test)/,'') | |
| def host.method_added(name) |
| require "stateful" | |
| class Folder < ActiveRecord::Base | |
| include Stateful | |
| # ... | |
| stateful do | |
| state :active | |
| state :inactive |
| describe "GET current" do | |
| before do | |
| @request.cookies['hidden_notices'] = "1,#{notices(:permanent).id}" | |
| get :current, :format => 'js' | |
| end | |
| it { should respond_with(:success) } | |
| it { should set_cookie(:hidden_notices).to("#{notices(:permanent).id}") } | |
| it { should render_template('notices/current') } | |
| end |
This code is no longer needed. Heroku has provided syslog drains for all users for free.
For better Heroku logging with Papertrail, check this out:
http://help.papertrailapp.com/kb/hosting-services/heroku#standalone
| import logging | |
| import riak | |
| log = logging.getLogger(__name__) | |
| class RiakCounter(object): | |
| def __init__(self, bucket, key): | |
| self.bucket = bucket | |
| self.bucket.set_allow_multiples(True) | |
| self.key = key |
| module CpuProf | |
| require 'ffi' | |
| extend FFI::Library | |
| ffi_lib FFI::CURRENT_PROCESS | |
| begin | |
| attach_function :start, :ProfilerStart, [:string], :void | |
| attach_function :stop, :ProfilerStop, [], :void | |
| rescue FFI::NotFoundError => e | |
| STDERR.puts "*** Are you sure you preloaded libprofiler?" |
| # install git | |
| sudo apt-get install g++ curl libssl-dev apache2-utils | |
| sudo apt-get install git-core | |
| # download the Node source, compile and install it | |
| git clone https://github.com/joyent/node.git | |
| cd node | |
| ./configure | |
| make | |
| sudo make install | |
| # install the Node package manager for later use |
| {% line_chart value:calls_per_minute regexp:'Database/Redis/[b-z].*' title:'CPM' %} | |
| {% line_chart value:average_value regexp:'Database/Redis/[b-z].*' title:'Average Time' %} | |
| {% line_chart value:max_value regexp:'Database/Redis/[b-z].*' title:'Max Time' %} | |
| {% line_chart value:calls_per_minute regexp:'Database/Redis/allWeb' title:'Redis Web CPM' %} | |
| {% line_chart value:calls_per_minute regexp:'Database/Redis/allOther' title:'Redis Background CPM' %} |
| /* | |
| As of version 1.1.2, Propane will load and execute the contents of | |
| ~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
| immediately following the execution of its own enhancer.js file. | |
| You can use this mechanism to add your own customizations to Campfire | |
| in Propane. | |
| Below you'll find two customization examples. |