Skip to content

Instantly share code, notes, and snippets.

View ingenthr's full-sized avatar

Matt Ingenthron ingenthr

View GitHub Profile
@ingenthr
ingenthr / gist:3718905
Last active October 10, 2015 16:28
Observe tester.
/*
* Copyright (C) 2011 Couchbase, Inc.
* All rights reserved.
*/
package com.couchbase.demo;
import com.couchbase.client.CouchbaseClient;
import java.util.ArrayList;
import java.util.Random;
import java.util.concurrent.ExecutionException;
@ingenthr
ingenthr / CouchbaseClientWrapper.java
Created November 3, 2012 02:55
Sample wrapper to deal with timeouts using a workaround
package com.couchbase.demo;
import com.couchbase.client.CouchbaseClient;
import java.io.IOException;
import java.net.URI;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
@ingenthr
ingenthr / libcouchbase.rb
Created December 5, 2012 01:24
libcouchbase GA formula
require 'formula'
def with_libev_plugin?
ARGV.include?('--with-libev-plugin')
end
def without_libevent_plugin?
ARGV.include?('--without-libevent-plugin')
end
@ingenthr
ingenthr / installtest.sh
Created December 11, 2012 08:40
Testing libcouchbase 2.0 with diferent event backends
brew uninstall libcouchbase
brew uninstall libcouchbase
brew uninstall libev
brew uninstall libevent
# pass one, test with default libevent
brew install https://github.com/couchbase/homebrew/raw/stable/Library/Formula/libcouchbase.rb && \
cbc cp ~/.bashrc && cbc view _all_docs?stale=false | head && \
brew uninstall libcouchbase && brew uninstall libevent && \\
# pass two, install with just libev
brew install --with-libev-plugin --without-libevent-plugin https://github.com/couchbase/homebrew/raw/stable/Library/Formula/libcouchbase.rb && \
@ingenthr
ingenthr / raiseTimeouts.sh
Created February 26, 2013 07:56
raising timeouts on ns_server in couchbase
set -xe
server=192.168.1.200
curl --data "ns_config:set({node, node(),{timeout, ns_memcached_outer}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, memcached_recv}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, memcached_stats_recv}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, ns_memcached_outer_heavy}},300000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, ns_memcached_outer_very_heavy}},600000)." -u Administrator:password http://$server:8091/diag/eval
curl --data "ns_config:set({node, node(),{timeout, ebucketmigrator_connect}},1200000)." -u Administrator:password http://$server:8091/diag/eval
@ingenthr
ingenthr / CompressingJsonTranscoder.java
Created July 8, 2013 22:05
An untested example of how to set CouchbaseClient with a transccoder that will try to compress JSON.
/**
* Copyright (C) 2013 Couchbase, Inc.
*
*/
package com.couchbase.demo;
import java.util.Date;
import net.spy.memcached.CachedData;
@ingenthr
ingenthr / VbucketLookup.java
Created July 23, 2013 23:03
Sample of looking up the node associated with a given key on Couchbase.
/**
* Copyright 2013, Couchbase, Inc. All rights reserved.
*/
package com.couchbase.demo.vbucketlookup;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
@ingenthr
ingenthr / README.md
Last active March 22, 2017 06:13
Various DTrace scripts for memcached

These are various scripts I've written in the past for tracing through memcached

LICENSE

The MIT License (MIT)

Copyright (c) 2013, Matt Ingenthron

Permission is hereby granted, free of charge, to any person obtaining a copy

@ingenthr
ingenthr / gist:6132789
Created August 1, 2013 16:04
footerizing
---------
Copyright 2010-2013 Couchbase, Inc.
Learn more at <http://www.couchbase.com/communities/c>.
@ingenthr
ingenthr / Demo.java
Created September 3, 2013 23:25
Adjusting CouchbaseClient tuneables via CouchbaseConnectionFactoryBuilder.
/**
* Copyright (C) 2009-2013 Couchbase, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*