Skip to content

Instantly share code, notes, and snippets.

@woodsaj
woodsaj / goroutines.txt
Created December 6, 2017 19:32
MT instance not consuming
goroutine 48039790 [running]:
runtime/pprof.writeGoroutineStacks(0x7f51e32857f8, 0xc423a2e700, 0x30, 0xc42cb497a0)
/usr/local/go/src/runtime/pprof/pprof.go:603 +0x79
runtime/pprof.writeGoroutine(0x7f51e32857f8, 0xc423a2e700, 0x2, 0xc466d92570, 0x40fdb8)
/usr/local/go/src/runtime/pprof/pprof.go:592 +0x44
runtime/pprof.(*Profile).WriteTo(0x105b820, 0x7f51e32857f8, 0xc423a2e700, 0x2, 0xc423a2e700, 0xc466d927a0)
/usr/local/go/src/runtime/pprof/pprof.go:302 +0x3b5
net/http/pprof.handler.ServeHTTP(0xc42cb493f1, 0x9, 0x7f51e1da60b0, 0xc423a2e700, 0xc432ecd600)
/usr/local/go/src/net/http/pprof/pprof.go:209 +0x1d1
net/http/pprof.Index(0x7f51e1da60b0, 0xc423a2e700, 0xc432ecd600)
@woodsaj
woodsaj / lock_test.go
Created September 19, 2018 07:40
Benchmark to compare shared locks vs per-thread locks
package input
import (
"fmt"
"sync"
"testing"
)
// simple datastruct to provide a lock around an int variable
type Data struct {
@woodsaj
woodsaj / generate-HAR.md
Created November 6, 2018 04:57
Instructions for generating HAR files with Chrome or Firefox

How to generate a HAR file in Chrome

Start by opening Google Chrome.

  • In Chrome, go to the page within our application where you are experiencing trouble

  • Select the Chrome menu (⋮) at the top-right of your browser window, then select Tools > Developer Tools.

  • The Developer Tools will open as a docked panel at the side or bottom of Chrome. Click on the Network tab.

  • Select the option Preserve log (at the top of the panel)

@woodsaj
woodsaj / walk_tree.py
Last active December 17, 2019 08:51
Walk graphite metrics tree from specified prefix
#!/usr/bin/python
from __future__ import print_function
import requests
import json
import argparse
try:
from Queue import Queue
except:
@woodsaj
woodsaj / ping.go
Created September 11, 2020 10:37
Example usage of github.com/woodsaj/go-pinger
package main
import (
"fmt"
"log"
"net"
"os"
"os/signal"
"strings"
"sync"