Skip to content

Instantly share code, notes, and snippets.

View sbtourist's full-sized avatar

Sergio Bossa sbtourist

View GitHub Profile
@sbtourist
sbtourist / largebatches.yaml
Last active November 27, 2023 17:31
largebatches.yaml
description: |
A key-value workload with batches over large values to test large batches
bindings:
rw_key: TEMPLATE(keydist,Uniform(0,1000000000));
large_rw_value: Hash(); TEMPLATE(valdist,Uniform(0,1000000000)); CharBufImage('A-Za-z0-9 _|/',16000000,HashRange(TEMPLATE(mintext,250000)TEMPLATE(addzeros,),TEMPLATE(maxtext,500000)TEMPLATE(addzeros,))); ToString();
blocks:
- tags:
phase: schema
@sbtourist
sbtourist / largemessagesV2.yaml
Last active November 27, 2023 09:59
largemessagesV2.yaml
description: |
A key-value workload with small and large values to test large messages
bindings:
large_rw_key: TEMPLATE(keydist,Uniform(0,1000000000));
large_rw_value: Hash(); TEMPLATE(valdist,Uniform(0,1000000000)); CharBufImage('A-Za-z0-9 _|/',16000000,HashRange(TEMPLATE(mintext,100000)TEMPLATE(addzeros,),TEMPLATE(maxtext,250000)TEMPLATE(addzeros,))); ToString();
small_rw_key: TEMPLATE(keydist,Uniform(1000000001,2000000000));
small_rw_value: Hash(); TEMPLATE(valdist,Uniform(0,1000000000)); CharBufImage('A-Za-z0-9 _|/',16000000,HashRange(TEMPLATE(mintext,50)TEMPLATE(addzeros,),TEMPLATE(maxtext,100)TEMPLATE(addzeros,))); ToString();
description: |
A workload with text keys, ~1kb text values and SAI.
scenarios:
default:
schema: run driver=cql tags==block:schema threads==1 cycles==UNDEF
rampup: run driver=cql tags==block:rampup cycles===TEMPLATE(rampup-cycles,10000000) threads=auto
main: run driver=cql tags==block:"main.*" cycles===TEMPLATE(main-cycles,10000000) threads=auto
bindings:
description: |
A workload with text keys, text values and range queries.
bindings:
seq_key: Mod(TEMPLATE(keycount,1000000000)); ToString();
seq_value: >-
Hash();
Mod(TEMPLATE(valuecount,1000000000));
CharBufImage('A-Za-z0-9 _|/',16000000,HashRange(TEMPLATE(mintext,100000)TEMPLATE(addzeroes,),TEMPLATE(maxtext,500000)TEMPLATE(addzeroes,)));
ToString();
How to run ETCD on K8S locally
1. Install any local K8S distribution. I've used microk8s: https://microk8s.io/
2. Install etcd so you can use etcdctl: https://github.com/etcd-io/etcd/releases/
3. Run etcd on k8s via the Bitnami image. Using microk8s:
$> microk8s kubectl run --image=bitnami/etcd:latest etcd --env ALLOW_NONE_AUTHENTICATION=yes --labels app=etcd
@sbtourist
sbtourist / gist:c8e1352bf90d1ea659b77a1966c204ed
Created March 2, 2017 12:19
solrconfig big filter cache
<?xml version="1.0" encoding="UTF-8" ?>
<!--
=======
Copyright DataStax, Inc.
Please see the included license file for details.
-->
<!--
SEQUENTIAL
CQL|SELECT * FROM demo.geo WHERE solr_query='{"q":"*:*","fq":"country:AS"}' LIMIT 1
CQL|SELECT * FROM demo.geo WHERE solr_query='{"q":"*:*","fq":"name:Reka"}' LIMIT 1
CQL|SELECT * FROM demo.geo WHERE solr_query='{"q":"*:*","fq":"published:2016-04-12"}' LIMIT 1
CQL|SELECT * FROM demo.geo WHERE solr_query='{"q":"*:*","fq":"published:2015-01-07"}' LIMIT 1
CQL|SELECT * FROM demo.geo WHERE solr_query='{"q":"*:*","fq":"name:Santa"}' LIMIT 1
CQL|SELECT * FROM demo.geo WHERE solr_query='{"q":"*:*","fq":"name:Landing"}' LIMIT 1
CQL|SELECT * FROM demo.geo WHERE solr_query='{"q":"*:*","fq":"name:Nāw"}' LIMIT 1
CQL|SELECT * FROM demo.geo WHERE solr_query='{"q":"*:*","fq":"published:1999-04-30"}' LIMIT 1
CQL|SELECT * FROM demo.geo WHERE solr_query='{"q":"*:*","fq":"name:Serra"}' LIMIT 1
package jmh.countdownlatch;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.GenerateMicroBenchmark;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.Setup;
@sbtourist
sbtourist / clamq_samples1.clj
Created January 8, 2011 17:34
Simple pipe from ActiveMQ to RabbitMQ
(ns clamq-samples1 (:use [clamq.protocol] [clamq.jms] [clamq.activemq] [clamq.rabbitmq] [clamq.pipes]))
(def activemq (jms-connection (activemq-connection "tcp://localhost:61616")))
(def rabbitmq (rabbitmq-connection "localhost"))
(open
(pipe {
:from {:connection activemq :endpoint "activemq"}
:to {:connection rabbitmq :endpoint {:routing-key "rabbitmq"}}
:transacted true
;; Protocol defining output with external logic:
(defprotocol Outputter (output [self logic]))
;; Simple record:
(defrecord Person [name])
;; Two protocol definitions: