Skip to content

Instantly share code, notes, and snippets.

View flushentitypacket's full-sized avatar

Ron Hong flushentitypacket

View GitHub Profile
@flushentitypacket
flushentitypacket / foundations.md
Last active November 26, 2018 20:16
Foundational readings for a t0tal n00b trying to break into React
# short test script to check whether request timeouts are affected by thread lock
import gevent
import gevent.monkey
import requests
import time
gevent.monkey.patch_all()
@flushentitypacket
flushentitypacket / http_load_test.sh
Last active July 18, 2020 16:56
Bash script to execute a parallel load test against some endpoint and print out the network latency data
#!/usr/bin/env bash
seq 1000 | \
time xargs -Idonotmatch -P 1000 \
curl "https://some.domain.here/path/to/resource?param=foo" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--write-out 'http_code:%{http_code} time_appconnect:%{time_appconnect} time_connect:%{time_connect} time_namelookup:%{time_namelookup} time_pretransfer:%{time_pretransfer} time_starttransfer:%{time_starttransfer} time_total:%{time_total}\n' \
--http1.1 -s -o /dev/null
@flushentitypacket
flushentitypacket / gevent_thread_demo.py
Created July 18, 2020 18:55
Difference between python thread vs gevent greenlet
#!/usr/bin/python
# Output is NOT interleaved
import gevent
def print_numbers(name):
count = 0
while count < 500:
count += 1