This file contains 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
# Dependencies: | |
# On CentOS you can install psycopg2 thus: | |
# | |
# sudo yum install postgresql-libs | |
# sudo yum install python-psycopg2 | |
import psycopg2; | |
import time | |
import random | |
from multiprocessing.dummy import Pool as ThreadPool |
This file contains 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
do $$ | |
declare | |
filler text[]; | |
counter int:=0; | |
begin | |
loop | |
filler[counter] := repeat('0123456789',1638); | |
counter:=counter+1; | |
end loop; | |
end $$; |
This file contains 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
#!/usr/bin/awk -f | |
# | |
# important: sed 's/\ \[wor/_[wor/' | |
# | |
{ process_name = $1; | |
pid = $2; | |
time = $4; | |
action = $5; | |
time = substr(time,1,length(time)-1); | |
if ( overall_begin_time == "" ) |
This file contains 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
#!/usr/bin/awk -f | |
{ pid=$2; | |
time=$4; | |
action=$5; | |
# remove colon from time | |
time=substr(time,1,length(time)-1); | |
# get first relative timestamp in output | |
if ( overall_begin_time == "" ) |
This file contains 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
#!/usr/bin/awk -f | |
{ pid=$2; | |
time=$4; | |
action=$5; | |
# wait groups | |
wait_class[0]="unknown"; | |
wait_class[1]="lwlock"; | |
wait_class[3]="lock"; | |
wait_class[4]="buffer_pin"; |
This file contains 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
#!/usr/bin/awk -f | |
{ pid=$2; | |
time=$4; | |
action=$5; | |
state=$7; | |
# backend states | |
backend_state[0]="undefined"; | |
backend_state[1]="idle"; | |
backend_state[2]="running"; |
This file contains 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
#!/usr/bin/awk -f | |
{ pid=$2; | |
time=$4; | |
action=$5; | |
event_nr=$7; | |
# wait groups | |
wait_class[1]="lwlock"; | |
wait_class[3]="lock"; | |
wait_class[4]="buffer_pin"; |
This file contains 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
#!/usr/bin/perl -w | |
# | |
# flamegraph.pl flame stack grapher. | |
# | |
# This takes stack samples and renders a call graph, allowing hot functions | |
# and codepaths to be quickly identified. Stack samples can be generated using | |
# tools such as DTrace, perf, SystemTap, and Instruments. | |
# | |
# USAGE: ./flamegraph.pl [options] input.txt > graph.svg | |
# |
This file contains 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
create or replace procedure check_orafce() | |
language plpgsql as $$ | |
declare | |
orafce_available int; | |
orafce_installed int; | |
begin | |
select count(*) into orafce_available from pg_available_extensions where name = 'orafce'; | |
if orafce_available > 0 then | |
raise info 'orafce extension available'; | |
else |
This file contains 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 java.sql.*; | |
import java.lang.*; | |
// | |
// javac -classpath postgresql-42.2.23.jar:. JdbcTest.java | |
// java -classpath postgresql-42.2.23.jar:. JdbcTest | |
// | |
public class JdbcTest { | |
private static final String user = "yugabyte"; |
NewerOlder