Skip to content

Instantly share code, notes, and snippets.

View tgrabiec's full-sized avatar

Tomasz Grabiec tgrabiec

View GitHub Profile
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDO1BnCLknF/K9firhitZpmYBvJtATfRQd0ROrNyTVr+nJaKECWbOvZsVZ+p7OBDWmqE1IblPqrYm97ap2RiHy8CRp/sjq7YVPAlLMQE5cEEHibVEZDj+1c/05Sowc/5NsvJTmk+cdtt0mNFvJfpRP2XDf75h8hZeHv7KMdEe2CNfQgVWnsZ8n46xXvQtfcWlbZo0aAiWnlZp8Q8kYnegYy1nHsYmW5CiIxd0rMAzt6JofUIKlyEF1KVJkNH11b9x0fiVz/wNMNx89rKsF9Vyoo1N923KpYZnQisCTrYY1u0WcOxJr9xSixVj5h+ixaCPAfzyx62OVW6JeQ4WFbMOyr tgrabiec@tgrabiec-N56VZ
@tgrabiec
tgrabiec / test.py
Last active November 18, 2020 22:14
from cassandra.cluster import Cluster
import random
cluster = Cluster()
session = cluster.connect()
session.execute('drop keyspace ks')
session.execute("create keyspace ks WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1 };")
session.set_keyspace('ks')
$ cat build/dbuild/scylla
scylla_home=/mnt/src/scylla2
ARGS=(-v "$HOME/.dtest:$HOME/.dtest" \
-v "$scylla_home:$scylla_home" \
-e SCYLLA_HOME="$SCYLLA_HOME")
${scylla_home}/tools/toolchain/dbuild ${ARGS[@]} -- ${scylla_home}/build/dev/scylla $@
On disk metadata size:
find /var/lib/scylla/data -name *.db -a ! \( -name "*-Data.db" -o -name "*-Index.db" \) | xargs du -ch
import gdb, gdb.printing, uuid, argparse
import re
from operator import attrgetter
from collections import defaultdict
import re
import random
def template_arguments(gdb_type):
n = 0
while True:
Interceptor (no root):
nc -kvvvl 3333 -c 'nc localhost 9042 | tee $(mktemp)'
ls -lt /tmp | head
hexdump -C /tmp/...
Tshark:
sudo tshark -i lo -O cql -x port 9042
import gdb, gdb.printing, uuid, argparse
import re
from operator import attrgetter
from collections import defaultdict
import re
import random
def template_arguments(gdb_type):
n = 0
while True:
perf probe -x /opt/scylladb/lib/libstdc++.so.6 __cxa_throw
perf probe -x /lib64/libstdc++.so.6 __cxa_throw
perf record --call-graph dwarf -e probe_libstdc:__cxa_throw_1 -p `pgrep scylla`
#
# Run cassandra-stress like this:
#
# cassandra-stress (...) -log file=cs.log
#
# Run this exporter like this:
#
# tail -f cs.log | sudo ./cassandra_stress_exporter &
#
# You don't need to restart exporter across c-s restarts.
#!/usr/bin/env bash
# Usage: make-flame-graph.sh <perf-data-file-path>
#
# Produces perf-data-file-path.svg with the corresponding flame graph.
#
set -e
fg_dir=~/FlameGraph