Skip to content

Instantly share code, notes, and snippets.

@woodsaj
woodsaj / stacktrace.txt
Created March 8, 2016 17:39
metric-tank stacktrace
This file has been truncated, but you can view the full file.
goroutine 44011258 [running]:
runtime/pprof.writeGoroutineStacks(0x7f5713578398, 0xc85bca55f0, 0x0, 0x0)
/usr/local/go/src/runtime/pprof/pprof.go:516 +0x84
runtime/pprof.writeGoroutine(0x7f5713578398, 0xc85bca55f0, 0x2, 0x0, 0x0)
/usr/local/go/src/runtime/pprof/pprof.go:505 +0x46
runtime/pprof.(*Profile).WriteTo(0xd88f60, 0x7f5713578398, 0xc85bca55f0, 0x2, 0x0, 0x0)
/usr/local/go/src/runtime/pprof/pprof.go:236 +0xd4
net/http/pprof.handler.ServeHTTP(0xc8bfeabf01, 0x9, 0x7f5720482878, 0xc85bca55f0, 0xca1bfebce0)
/usr/local/go/src/net/http/pprof/pprof.go:210 +0x37e
net/http/pprof.Index(0x7f5720482878, 0xc85bca55f0, 0xca1bfebce0)
#!/bin/sh
curl -H "Authorization: Bearer not_very_secret_key" -H "Content-Type: application/json" -X POST http://localhost:8081/metrics -d '[
{
"name":"my.metric.name",
"interval":60,
"value":1.23,
"time":1465043400,
"tags":[
"imported"
package main
import (
"testing"
"strconv"
)
type Data struct {
Name string
Tags []string
@woodsaj
woodsaj / import_idx.go
Last active October 31, 2016 22:44
migrate metrictank indexes from ES to cassandra.
package main
import (
"flag"
"fmt"
"log"
"sync"
"time"
"github.com/gocql/gocql"
package main
import (
"bytes"
"io"
"io/ioutil"
"log"
"strings"
"github.com/go-macaron/binding"
package api
import (
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/raintank/metrictank/cluster"
@woodsaj
woodsaj / carbon-relay-ng-on-prem.ini
Last active August 9, 2017 16:41
Sovrn HostedMetrics
## Global settings ##
instance = "on-prem"
max_procs = 4
spool_dir = "spool"
pid_file = "carbon-relay-ng.pid"
## Logging ##
# one of critical error warning notice info debug
# see docs/logging.md for level descriptions
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
@woodsaj
woodsaj / tsdb-gw.txt
Created September 18, 2017 10:11
tsdb-gw panic
fatal error: concurrent map iteration and map write
2017/09/17 17:40:37 [I] graphiteProxy: request to graphite-17303-medium-wix:8080 failed, will retry: context canceled
goroutine 21921 [running]:
runtime.throw(0x9ad065, 0x26)
/usr/local/go/src/runtime/panic.go:596 +0x95 fp=0xc4206a29e0 sp=0xc4206a29c0
runtime.mapiternext(0xc4206a2ba0)
/usr/local/go/src/runtime/hashmap.go:737 +0x7ee fp=0xc4206a2a90 sp=0xc4206a29e0
runtime.mapiterinit(0x958d80, 0xc421196030, 0xc4206a2ba0)
/usr/local/go/src/runtime/hashmap.go:727 +0x2b3 fp=0xc4206a2ae8 sp=0xc4206a2a90
@woodsaj
woodsaj / test.py
Last active November 30, 2017 09:53
bufferedHTTPResonse
import sys
sys.path.append('/opt/graphite/webapp')
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'graphite.settings')
from graphite.http_pool import http
from graphite.util import unpickle
import time
import io
now = int(time.time())