This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"runtime" | |
"github.com/azer/atlas" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.box = "precise64" | |
config.vm.box_url = "http://files.vagrantup.com/precise64.box" | |
config.vm.provider :virtualbox do |vb| | |
vb.customize ["modifyvm", :id, "--memory", "1024"] | |
vb.customize ["modifyvm", :id, "--cpus", "8"] | |
vb.customize ["modifyvm", :id, "--ioapic", "on"] | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.couchbase.client.CouchbaseClient; | |
import com.couchbase.client.CouchbaseConnectionFactoryBuilder; | |
import java.net.URI; | |
import java.util.ArrayList; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.TimeUnit; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
import string | |
import random | |
import memcache | |
FRAGMENTATION_THRESHOLD = 3 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# python data.py <cluster-ip> <bucket> | |
from couchbase import Couchbase | |
from couchbase import FMT_BYTES | |
from random import choice | |
from string import lowercase | |
import sys | |
TIMES_TO_APPEND = 1626 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function microtime_float() | |
{ | |
list($usec, $sec) = explode(" ", microtime()); | |
return ((float)$usec + (float)$sec); | |
} | |
$starttime = microtime_float(); | |
$cb = new Couchbase("10.4.2.115:8091", "","","default", false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.couchbase.client.CouchbaseClient; | |
//import net.spy.memcached.transcoders.SerializingTranscoder; | |
import java.util.Random; | |
import java.net.URI; | |
import java.util.*; | |
import java.lang.*; | |
import java.util.concurrent.TimeUnit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set test key to cluster | |
client.set("test-key", "couchbase!").get(); | |
// Grab cas value | |
CASValue<Object> lock = client.gets("test-key"); | |
long cas_id = lock.getCas(); | |
client.cas("test-key", cas_id, "test-value"); | |
System.out.println((String) client.get("test-key")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from couchbase import Couchbase | |
from couchbase import FMT_JSON | |
from couchbase.views.params import Query | |
from couchbase.views.iterator import View | |
import datetime | |
import json | |
from operator import itemgetter | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::{Read, Write}; | |
use std::net::{TcpListener, TcpStream}; | |
use std::str; | |
use std::thread; | |
fn handle_client(mut stream: TcpStream) { | |
match stream.peer_addr() { | |
Err(_) => (), | |
Ok(pn) => println!("Received connection from: [{}]", pn), | |
} |
OlderNewer