Skip to content

Instantly share code, notes, and snippets.

View noahgoldman's full-sized avatar

Noah Goldman noahgoldman

View GitHub Profile
Last login: Tue Jan 29 11:19:59 on ttys008
cd % [761/1820]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
~ update in-place
<= read (data resources)
Terraform will perform the following actions:
@noahgoldman
noahgoldman / concurrency.txt
Created November 29, 2018 17:09
factory-go failing tests under the race detector
==================
WARNING: DATA RACE
Read at 0x00c000016508 by goroutine 16:
github.com/bluele/factory-go/factory.(*Factory).SeqInt.func1()
/Users/ngoldman/projects/golang/src/github.com/bluele/factory-go/factory/factory.go:187 +0x8f
github.com/bluele/factory-go/factory.(*Factory).build()
/Users/ngoldman/projects/golang/src/github.com/bluele/factory-go/factory/factory.go:383 +0x8cc
github.com/bluele/factory-go/factory.(*Factory).create()
/Users/ngoldman/projects/golang/src/github.com/bluele/factory-go/factory/factory.go:412 +0x1a3
github.com/bluele/factory-go/factory.(*Factory).CreateWithOption()
@noahgoldman
noahgoldman / importsrv_benchmarks.md
Created April 9, 2018 18:53
Performance of importsrv with different hash methods

Reduced allocations (fasthash/fnv1a)

goos: darwin
goarch: amd64
pkg: github.com/stripe/veneur/importsrv
BenchmarkImportServerSendMetrics/InputSize=10-8                   100000             14391 ns/op            4360 B/op         31 allocs/op
BenchmarkImportServerSendMetrics/InputSize=100-8                   50000             36363 ns/op            5464 B/op        120 allocs/op
BenchmarkImportServerSendMetrics/InputSize=1000-8                  10000            135716 ns/op           25305 B/op        487 allocs/op
BenchmarkImportServerSendMetrics/InputSize=10000-8                  2000            923453 ns/op          208295 B/op        821 allocs/op
PASS
@noahgoldman
noahgoldman / after.txt
Last active March 28, 2018 21:47
veneur performance of the "importsrv" package before and after reducing the number of channel send operations
go test -run=^$ -bench=BenchmarkImportServerSendMetrics -cpuprofile=cpu.out -benchmem ./importsrv && go tool pprof -top cpu.out | head -n20
goos: darwin
goarch: amd64
pkg: github.com/stripe/veneur/importsrv
BenchmarkImportServerSendMetrics/InputSize=10-8 100000 17711 ns/op 6384 B/op 78 allocs/op
BenchmarkImportServerSendMetrics/InputSize=100-8 20000 60996 ns/op 27610 B/op 617 allocs/op
BenchmarkImportServerSendMetrics/InputSize=1000-8 5000 380833 ns/op 249355 B/op 5488 allocs/op
BenchmarkImportServerSendMetrics/InputSize=10000-8 500 3350251 ns/op 2448077 B/op 50818 allocs/op
PASS
ok github.com/stripe/veneur/importsrv 8.012s
go test -bench=. -benchmem -benchtime=5s ./proxysrv
goos: darwin
goarch: amd64
pkg: github.com/stripe/veneur/proxysrv
BenchmarkProxyServerSendMetrics/InputSize=10-8 30000 317886 ns/op 48532 B/op 879 allocs/op
BenchmarkProxyServerSendMetrics/InputSize=100-8 20000 463323 ns/op 110525 B/op 1908 allocs/op
BenchmarkProxyServerSendMetrics/InputSize=1000-8 5000 1400174 ns/op 728992 B/op 11847 allocs/op
BenchmarkProxyServerSendMetrics/InputSize=10000-8 1000 9750800 ns/op 6455033 B/op 111079 allocs/op
PASS
ok github.com/stripe/veneur/proxysrv 44.359s
@noahgoldman
noahgoldman / gist:c5f50eae303f2af0c1106a7000f4fbbf
Last active March 23, 2018 18:48
The conntrack kernel module loads the first time you even list the "nat" table in iptables
[ngoldman@px-awstest-0201 ~]$ lsmod
Module Size Used by
xt_comment 1034 2
xt_owner 1252 1
iptable_filter 2793 1
ip_tables 17895 1 iptable_filter
ip6table_filter 2889 0
ip6_tables 18796 1 ip6table_filter
ipv6 336282 125
ixgbevf 62017 0
@Library('qools-jenkins-libraries') _
PROJECT_NAME = "data-interchange-web"
VERSION = "1.0.${BUILD_NUMBER}"
IMAGE_NAME = "${PROJECT_NAME}:${VERSION}"
currentBuild.displayName = "${IMAGE_NAME}"
node {
echo "hello world"
echo "${IMAGE_NAME}"
@noahgoldman
noahgoldman / histograms-serialization.md
Last active February 16, 2018 22:05
Benchmarks of new Veneur histogram serialization

With new Histogram value (aggregations included)

goos: darwin
goarch: amd64
pkg: github.com/stripe/veneur/samplers
BenchmarkHistoExport/Samples=10-8         100000             15909 ns/op
BenchmarkHistoExport/Samples=100-8         50000             33708 ns/op
BenchmarkHistoExport/Samples=1000-8                50000             39924 ns/op
BenchmarkHistoExport/Samples=10000-8               50000             39777 ns/op
BenchmarkHistoCombine/Samples=10-8                 20000             72863 ns/op
ok test_qfs_connect
ok test_get_metaserver_location
ok test_qfs_user_functions
ok test_qfs_cleanup
ok test_qfs_mkdir
ok test_qfs_mkdirs
ok test_qfs_cd
ok test_qfs_getwd
ok test_readdir
ok test_readdirnames
@noahgoldman
noahgoldman / tv_renamer.py
Created January 13, 2016 20:55
Rename and movee TV shows to match the recommended plex file structure
# Rename and movee TV shows to match the recommended plex file structure
#
# Example:
# /TV Shows
# /Heroes
# /Season 02
# Heroes - s02e05-e08.mkv
# /Season 04
# Heroes - s04e01-e02.mkv
# Heroes - s04e03.mkv