Skip to content

Instantly share code, notes, and snippets.

View kmuthukk's full-sized avatar

Kannan Muthukkaruppan kmuthukk

View GitHub Profile
# pip install yb-cassandra-driver
from cassandra.cluster import Cluster
from cassandra import ConsistencyLevel
import time
import random
from multiprocessing.dummy import Pool as ThreadPool
# Load Phase params
num_write_threads=1
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
import time;
from multiprocessing.dummy import Pool as ThreadPool
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
from multiprocessing.dummy import Pool as ThreadPool
num_target_refs = 10
@kmuthukk
kmuthukk / ysql_user_msgs.py
Last active November 15, 2019 21:08
YSQL Sample Program - user messages/actions table
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
import time
conn = psycopg2.connect("host=localhost dbname=yugabyte user=yugabyte port=5433")
# Dependencies:
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
import time;
def create_table():
@kmuthukk
kmuthukk / ycql_null_insert.py
Created October 26, 2019 05:52
Issue With Invalid/NULL Range Column
# pip install yb-cassandra-driver
from cassandra.cluster import Cluster
from cassandra.query import UNSET_VALUE
import time
import random
import os
from multiprocessing.dummy import Pool as ThreadPool
package main
import (
"fmt"
"log"
"time"
"github.com/gocql/gocql"
)
# pip install yb-cassandra-driver
from cassandra.cluster import Cluster
import time
import random
from multiprocessing.dummy import Pool as ThreadPool
# Load Phase params
num_write_threads=4
num_users=500
@kmuthukk
kmuthukk / sql_user_actions_prep_stmt.py
Last active August 11, 2019 03:42
Simple INSERTs into a user_actions table (with use of prepare)
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
import time
conn = psycopg2.connect("host=localhost dbname=postgres user=postgres port=5433")
@kmuthukk
kmuthukk / sql_user_actions_without_prepare.py
Last active August 11, 2019 03:43
Simple INSERTs into a user_actions table (without use of prepare step)
# On CentOS you can install psycopg2 thus:
#
# sudo yum install postgresql-libs
# sudo yum install python-psycopg2
import psycopg2;
import time
conn = psycopg2.connect("host=localhost dbname=postgres user=postgres port=5433")