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
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <stdexcept> | |
#include <hiredis.h> | |
using namespace std; | |
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
OBJ = genload.o | |
BINS = genload | |
CC=g++ | |
OPTIMIZATION?=-O3 | |
CFLAGS?=$(OPTIMIZATION) $(ARCH) $(PROF) -I ../hiredis | |
CCLINK?=-pthread | |
LDFLAGS?=-L../hiredis -lhiredis -lm | |
OBJ = example.o |
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
> ~/tcp_redis_monitor.py 6379 | |
Timestamp Nb TX bytes RX bytes TX RMA RX RMA | |
1333983822.943 1 0 0 0.000 0.000 | |
1333983823.193 1 0 0 0.000 0.000 | |
1333983824.194 1 0 0 0.000 0.000 | |
1333983825.195 1 0 0 0.000 0.000 | |
1333983826.196 1 0 0 0.000 0.000 |
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
/* Code borrowed from hiredis examples */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <signal.h> | |
#include "hiredis.h" | |
#include "async.h" | |
#include "adapters/ae.h" |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <signal.h> | |
#include <time.h> | |
#include "hiredis.h" | |
#include "async.h" | |
#include "adapters/ae.h" | |
#include "sha1.h" |
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
// Change propagateExpire function in db.c as follows: | |
void propagateExpire(redisDb *db, robj *key) { | |
/* HORRIBLE HACK STARTS HERE */ | |
/* robj *argv[2]; */ | |
robj *argv[3]; | |
/* HORRIBLE HACK ENDS HERE */ | |
argv[0] = shared.del; |
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 "bytes" | |
import "time" | |
import "fmt" | |
func ClusterSlot(key []byte) uint16 { | |
if start := bytes.IndexByte(key, '{'); start >= 0 { | |
if end := bytes.IndexByte(key[start+1:], '}'); end > 0 { |
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
var redis = require('redis') | |
var rc = redis.createClient(6379, 'localhost'); | |
function create( target, callback ) | |
{ | |
x = [] | |
for ( var i=0; i<40; ++i ) | |
{ | |
// Only 100K entries in the reverse index | |
var n = 1000*Math.round(Math.random()*100000); |
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 | |
# -*- coding: utf-8 -*- | |
# ---------------------------------------------------- | |
import redis, random | |
POOL = redis.ConnectionPool(host='localhost', port=6379, db=0) | |
NUSERS = 10000 | |
NTAGS = 500 |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <signal.h> | |
#include "hiredis.h" | |
#include "async.h" | |
#include "adapters/libevent.h" | |
void subCallback(redisAsyncContext *c, void *r, void *priv) { | |
redisReply *reply = r; |
NewerOlder