Skip to content

Instantly share code, notes, and snippets.

describe :child_watcher_behavior do
describe :async_watch, :async => true do
it_should_behave_like "all success return values"
before do
@watcher = Zookeeper::Callbacks::WatcherCallback.new
@cb = Zookeeper::Callbacks::StringsCallback.new
@rv = zk.get_children(:path => path, :watcher => @watcher, :watcher_context => path, :callback => @cb, :callback_context => path)
wait_until { @cb.completed? }
require 'zookeeper'
require 'zk-server'
require 'fileutils'
require 'tmpdir'
SLEEP_TIME = 30
STDOUT.sync = true
if ENV['DEBUG']
def zookeeper_logger(from)
diff -ur zkc-3.4.5-orig/c/src/zookeeper.c zkc-3.4.5/c/src/zookeeper.c
--- zkc-3.4.5-orig/c/src/zookeeper.c 2012-09-30 10:53:32.000000000 -0700
+++ zkc-3.4.5/c/src/zookeeper.c 2013-09-07 21:25:24.000000000 -0700
@@ -1650,14 +1650,16 @@
// a PING
if (zh->state==ZOO_CONNECTED_STATE) {
send_to = zh->recv_timeout/3 - idle_send;
- if (send_to <= 0 && zh->sent_requests.head==0) {
-// LOG_DEBUG(("Sending PING to %s (exceeded idle by %dms)",
-// format_current_endpoint_info(zh),-send_to));
#!/bin/bash
set -e
USERNAME=
TOKEN=
METRIC=
SLEEP=5
probe() {
namespace :test do
task :turn_off_verbose do
ObjectSpace.each_object(Rake::TestTask) { |t| t.verbose = false }
end
end
%w(test:units test:functionals test:integration).each do |task_name|
Rake::Task[task_name].prerequisites << 'test:turn_off_verbose'
end
@eric
eric / bluebox.coffee
Last active December 25, 2015 17:19
Pipe all messages from BlueBox customer chat into Campfire
# Description:
# Providing ways to interact with bluebox
#
# Commands:
# hubot bluebox chat on - Enable chat transcripts
# hubot bluebox chat off - Disable chat trascripts
#
# Dependencies:
# "cookie": "0.1.0"
# "cheerio": "0.12.3"
class Option
end
class None < Option
def map(&block)
return None
end
end
class Some < Option
@eric
eric / papertrail.coffee
Last active January 1, 2016 18:49
Work in progress Papertrail hubot plugin
# Description:
# Query logs from Papertrail
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_PAPERTRAIL_API_TOKEN - Papertrail API token
#
# Commands:
{"$id":"1","Error":"This salt has already been used in the last 8 hour period"}
Manifest-Version: 1.0
Implementation-Vendor: net.lag
Implementation-Title: kestrel
Implementation-Version: 2.4.1
Implementation-Vendor-Id: net.lag
Class-Path: libs/scala-library.jar libs/ostrich-8.2.9.jar libs/scala-j
son-3.0.1.jar libs/util-core-5.3.13.jar libs/util-eval-5.3.13.jar lib
s/scala-compiler.jar libs/util-logging-5.3.13.jar libs/util-jvm-5.3.1
3.jar libs/naggati_2.9.2-4.1.0.jar libs/finagle-core-5.3.19.jar libs/
netty-3.5.5.Final.jar libs/util-collection-5.3.13.jar libs/jsr305-1.3