Skip to content

Instantly share code, notes, and snippets.

View andrewbaptist's full-sized avatar

Andrew Baptist andrewbaptist

  • Cockroach Labs
  • Bryn Mawr, PA
View GitHub Profile
echo "graph { ranksep=1 "
cd nodes; for x in * ; do echo "$x -- { "; grep -h "231010 16:40.*unable to connect to" $x/logs/* | grep -o "unable to connect to n[0-9]*" | grep -o '[0-9]*$' | sort | uniq ; echo "}" ; done ; cd ..
cat nodes.json | jq '.nodes[] | select(.updated_at > '`date -v-7d +%s`000000000').desc | {id: .node_id, locality: .locality.tiers[]} | select (.locality.key == "region") | {id: .id, region: .locality.value}' | jq -c -s -r 'group_by(.region)[] | {cluster: (.[0].region), label: (.[0].region), value:[.[] | .id]}' | sed -e 's/"//g' -e 's/{cluster:/subgraph cluster_/' -e 's/,label:/{label=/' -e 's/,value:\[/ /' -e 's/\]//'
echo "}"
# Setup
roachprod create -n 7 --gce-machine-type=n2d-standard-16 --local-ssd=true $CLUSTER
roachprod put $CLUSTER ./artifacts/cockroach
roachprod start $CLUSTER:1-6
# Init ranges - do not use --splits - it becomes invasive.
roachprod run $CLUSTER:1 "./cockroach workload init kv --splits 0"
# Write some initial data
./dev build --cross cockroach workload
# Set up cluster
roachprod create $CLUSTER -n 7
roachprod grafana-start $CLUSTER
roachprod stop $CLUSTER:1-7
roachprod put $CLUSTER:1-6 artifacts/cockroach ./cockroach
roachprod start $CLUSTER:1-6
roachprod put $CLUSTER:7 artifacts/workload ./workload
@andrewbaptist
andrewbaptist / EvenMoreStats
Created August 25, 2022 20:37
Better stats
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
@andrewbaptist
andrewbaptist / Decommission-full.json
Last active November 15, 2022 20:27
Decommission-full
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,