Skip to content

Instantly share code, notes, and snippets.

View theemadnes's full-sized avatar

A Mattson theemadnes

View GitHub Profile
@theemadnes
theemadnes / gist:28b177c953bedf63b6ed1d5a3c396da8
Created September 28, 2020 14:28
hey -> get-time - 20 concurrent workers, 100000 requests
# no limit - no HPA
kubectl apply -f k8s_deployment-alex-no-limit.yaml
./hey_linux_amd64 -c 20 -n 100000 http://X.X.X.X/get-time
Summary:
Total: 10.1857 secs
Slowest: 0.0477 secs
Fastest: 0.0008 secs
apiVersion: apps/v1
kind: DaemonSet
metadata:
namespace: kube-system
labels:
k8s-app: fluentd-gcp
name: fluentd-gcp-v2.0
spec:
selector:
matchLabels:
@theemadnes
theemadnes / csv_to_dict.py
Created August 21, 2017 04:18
Dome9 key-value nested CSV to Python dict
# this function decomposes the funky key-value nested CSV event message Dome9 uses for regular alerts
def csv_to_dict(event_message):
regex = r"\[[A-Za-z0-9\s\-_,:/()|\.@=]*\]"
# capture all nested kv in []
nested_msg = re.findall(regex, event_message)
# remove all nested kv in
msg_pruned = re.sub(regex, '', event_message)
# clip [] from nested message