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
# https://pypi.org/project/gremlinpython/ | |
from gremlin_python.process.anonymous_traversal import traversal | |
from gremlin_python.process.traversal import IO | |
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection | |
import ssl | |
import datetime | |
import sys | |
if __name__ == '__main__': |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: tinkerbench | |
namespace: aerospike-graph | |
labels: | |
app: tinkerbench | |
spec: | |
replicas: 1 | |
selector: |
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
From a production satellite: | |
1. Port forward from the pod | |
I=0; for API in $(kubectl -n satellite get pods | rg api | awk '{print $1}'); do I=$(($I+1)); kubectl -n satellite port-forward $API 5999$I:5999 & done | |
2. Hit the db trace debug endpoint | |
curl 127.0.0.1:5999{1,2,3}/debug/run/trace/db | |
3. Perform desired uplink operation, i.e. upload/download/etc |
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
package main | |
// stringMatch returns a list of indexes of the starting positions of the | |
// matching substr, does not count overlapping matches. | |
// worst case runtime: len(str) * len(substr) | |
// pathological inputs would be a substr that doesn't matches but has many similar chars | |
// so that for every char in str we would iterate thru all chars in the substr | |
// ex: aaaaaaaaa, aaad | |
// typical performance len(str) plus however many occurrences of the matching first chars of substr | |
func bruteStringMatch(str, substr string) []int { |
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
package main | |
import ( | |
"math/rand" | |
"testing" | |
"time" | |
) | |
const ( | |
random = 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
package main | |
func quicksort(input []int) { | |
if len(input) < 2 { | |
return | |
} | |
// pivot is a pointer to the last item in the input array | |
pivot := len(input) - 1 |
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
$ cockroach sql --url 'postgres://postgres:<PW>@us-central1-352.gcp-us-central1.cockroachlabs.cloud:26257/satellite?sslmode=verify-full&sslrootcert=us-central1-ca.crt' --execute "select node_id, session_id, session_start, oldest_query_start, age(clock_timestamp(), oldest_query_start::timestamptz), substring(active_queries,0,50) as query from [show sessions] where oldest_query_start is not null order by oldest_query_start asc limit 10;" | |
node_id | session_id | session_start | oldest_query_start | age | query | |
+---------+----------------------------------+----------------------------------+----------------------------------+-----------------+---------------------------------------------------+ | |
1 | 15ea0c2329edfa000000000000000001 | 2020-01-15 11:32:44.513491+00:00 | 2020-01-15 12:59:16.03245+00:00 | 02:53:43.354511 | INSERT INTO used_serials(serial_number_id, storag | |
1 | 15ea0c232b4c65570000000000000001 | 2 |
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
CREATE TABLE pathdata ( | |
fullpath bytea PRIMARY KEY, | |
metadata bytea NOT NULL | |
); | |
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
ALTER TABLE ONLY public.api_keys | |
ADD CONSTRAINT api_keys_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id) ON DELETE CASCADE; | |
ALTER TABLE ONLY public.bucket_metainfos | |
ADD CONSTRAINT bucket_metainfos_project_id_fkey FOREIGN KEY (project_id) REFERENCES public.projects(id); | |
ALTER TABLE ONLY public.stripecoinpayments_apply_balance_intents | |
ADD CONSTRAINT fk_transactions FOREIGN KEY (tx_id) REFERENCES public.coinpayments_transactions(id) ON DELETE CASCADE; |
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
CREATE TABLE accounting_rollups ( | |
id bigserial NOT NULL, | |
node_id bytea NOT NULL, | |
start_time timestamp with time zone NOT NULL, | |
put_total bigint NOT NULL, | |
get_total bigint NOT NULL, | |
get_audit_total bigint NOT NULL, | |
get_repair_total bigint NOT NULL, | |
put_repair_total bigint NOT NULL, | |
at_rest_total double precision NOT NULL, |
NewerOlder