Skip to content

Instantly share code, notes, and snippets.

View nickva's full-sized avatar

Nick Vatamaniuc nickva

  • USA
View GitHub Profile
@nickva
nickva / view_cycle.py
Created February 7, 2026 17:32
Create and query couchdb views
#!/usr/bin/env python
import os
import sys
import time
import uuid
import random
import requests
import argparse
import configparser
@nickva
nickva / cwb_bench2.erl
Created February 14, 2026 20:16
Erlang/OTP segfault
-module(cwb_bench2).
-export([run/5, status/1, stop/1]).
-export([init/1, terminate/2]).
-export([handle_call/3, handle_cast/2, handle_info/2]).
-behaviour(gen_server).
-define(HIBERNATE_DEFAULT, true).
-record(q, {
@nickva
nickva / view_bench.py
Created April 29, 2026 06:04
Build a CouchDB view and time it
#!/usr/bin/env python3
#
# view_bench.py --ndocs 100000 --doc-size 1500
#
import time
import argparse
import requests
TIMEOUT = 120
@nickva
nickva / rep_bench.py
Created May 5, 2026 06:10
Benchmark replication
#!/usr/bin/env python3
"""
replicator benchmark
# 1kb docs, single replication
rep_bench.py --ndocs 50000 --doc-size 1024
# faster polling, don't recreate the source
rep_bench.py --keep-source --poll-interval 1 \
@nickva
nickva / reduce_group_bench.py
Created June 21, 2026 04:32
Benchmark CouchDB reduce view with buit-in reducer
#!/usr/bin/env python3
#
# Benchmark built-in reduce
# Example:
# reduce_group_bench.py --ndocs 200000
import time
import argparse
import requests
import statistics