This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import string | |
import datetime | |
import mysql.connector | |
import time | |
def random_string(length=10): | |
return ''.join(random.choices(string.ascii_lowercase + string.digits, k=length)) | |
def random_date(start_year=2000, end_year=2025): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mysql.connector | |
import json | |
import os | |
import random | |
import string | |
from datetime import datetime, timedelta | |
# Config — replace with your actual TiDB credentials |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import os | |
import subprocess | |
import json | |
import sys | |
from threading import Thread | |
from queue import Queue | |
# global variables | |
cnt = {'total': 0, 'need compaction': 0, 'skipped': 0} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
#!/bin/bash | |
for i in {1..19} | |
do | |
echo "Starting sbtest$i..." | |
nohup python3 gc_test.py sbtest$i > "sbtest$i.out" 2>&1 & | |
sleep 5 | |
done | |
''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mysql.connector | |
import time | |
from concurrent.futures import ThreadPoolExecutor | |
def prepare_test_data(cursor, conn): | |
cursor.execute("DROP TABLE IF EXISTS institutions") | |
cursor.execute(""" | |
CREATE TABLE institutions ( | |
id INT PRIMARY KEY, | |
data VARCHAR(255) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mysql.connector | |
import time | |
# Connect to MySQL database | |
conn = mysql.connector.connect( | |
host="127.0.0.1", | |
user="root", | |
port="4000", | |
database="test" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
import mysql.connector | |
import uuid | |
import random | |
''' | |
create table tb ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mysql.connector | |
from mysql.connector import pooling | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
import logging | |
import time | |
import sys | |
import random | |
import string | |
# Database connection details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "mysql-connector-python", | |
# ] | |
# /// | |
import threading | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import mysql.connector | |
from mysql.connector import Error | |
import random | |
import string | |
import time | |
from datetime import datetime, timedelta | |
from collections import Counter | |
import logging |
NewerOlder