Skip to content

Instantly share code, notes, and snippets.

View roidrage's full-sized avatar
🌱
Planting seeds

Mathias Meyer roidrage

🌱
Planting seeds
View GitHub Profile
#!/usr/bin/env ruby
require 'socket'
host = ARGV[0] || 'localhost'
port = ARGV[1] || '6379'
trap(:INT) {
exit
}
# Drop into an initializer and bask in the glorious output of the queries CouchPotato fires
# and enjoy the summary of all the queries fired per request in your log file, just like
# in the good old ActiveRecord days.
# Disabled for test environment, because it simply didn't work
unless Rails.env.test?
class Tracker
include Singleton
def add(runtime)
Thread.current[:couch_runtime] ||= 0
Thread.current[:couch_runtime] += runtime
compiler-4.6.4.ez
crypto-1.6.3
crypto-1.6.3.ez
erts-5.7.4.ez
et-1.3.3
et-1.3.3.ez
eunit-2.1.4
eunit-2.1.4.ez
gs-1.5.11
gs-1.5.11.ez
function(key, values, rereduce) {
Array.prototype.unique = function() {
var a = [];
var l = this.length;
for(var i=0; i<l; i++) {
for(var j=i+1; j<l; j++) {
// If this[i] is found later in the array
if (this[i] === this[j])
j = ++i;
}
# Logfile created on Tue Apr 27 14:52:11 +0000 2010 by logger.rb/22285
[Tue, 27 Apr 2010 14:52:11 +0000] INFO: Starting Chef Solo Run
[Tue, 27 Apr 2010 14:52:11 +0000] DEBUG: Loading plugin os
[Tue, 27 Apr 2010 14:52:11 +0000] DEBUG: Loading plugin ruby
[Tue, 27 Apr 2010 14:52:11 +0000] DEBUG: Loading plugin languages
[Tue, 27 Apr 2010 14:52:11 +0000] DEBUG: Loading plugin kernel
[Tue, 27 Apr 2010 14:52:11 +0000] DEBUG: ---- Begin uname -s STDOUT ----
[Tue, 27 Apr 2010 14:52:11 +0000] DEBUG: Linux
[Tue, 27 Apr 2010 14:52:11 +0000] DEBUG: ---- End uname -s STDOUT ----
[Tue, 27 Apr 2010 14:52:11 +0000] DEBUG: ---- Begin uname -s STDERR ----
{"error":"normal","reason":"{gen_server,call,\n [couch_query_servers,\n {ret_proc,{proc,<0.9771.133>,<<\"javascript\">>,\n {couch_os_process,prompt},\n {couch_os_process,set_timeout},\n {couch_os_process,stop}}}]}"}
gemcutter => redis downloads spec
=================================
keys
----
downloads => global counter for all gem downloads
downloads:today => sorted set for downloads from today
downloads:rubygem:rails => counter for all rails downloads
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads
Apache CouchDB 1.0.0 (LogLevel=info) is starting.
=SUPERVISOR REPORT==== 15-Jul-2010::20:56:26 ===
Supervisor: {local,couch_primary_services}
Context: start_error
Reason: {{badmatch,{'EXIT',{{badmatch,{error,eacces}},
[{couch_log,init,1},
{gen_event,server_add_handler,4},
{gen_event,handle_msg,5},
{proc_lib,init_p_do_apply,3}]}}},
sudo mv org.apache.couchdb.org /Library/LaunchDaemons
sudo launchctl -w load /Library/LaunchDaemons/org.apache.couchdb.plist
% curl 'localhost:5984/simply_stored_test/_design/post/_view/association_post_belongs_to_user?endkey=%5B%2250b2d793a02b25e2f43ab2975c869fc5u9999%22%5D&reduce=false&startkey=%5B%2250b2d793a02b25e2f43ab2975c869c5%22%5D&descending=false&startkey_docid=50b2d793a02b25e2f43ab2975c869480'
{"total_rows":3,"offset":1,"rows":[
{"id":"50b2d793a02b25e2f43ab2975c869480","key":["50b2d793a02b25e2f43ab2975c869fc5","2010/07/23 09:09:58 +0000"],"value":1},
{"id":"50b2d793a02b25e2f43ab2975c86994f","key":["50b2d793a02b25e2f43ab2975c869fc5","2010/07/23 09:09:58 +0000"],"value":1}
]}