This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function transform_payload(payload) { | |
var headers = {"content-type": "application/json", | |
"X-Insert-Key": "newrelic-insights-insert-api-key"}; | |
var body = [{"eventType": payload["event"], | |
"timestamp": Date.parse(payload["timestamp"]), | |
"session_id": payload["session"]}]; | |
return {"status": "ok", "headers": headers, "body": body}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"runtime/causalprof" | |
"net/http" | |
"bufio" | |
"os" | |
"math/rand" | |
"fmt" | |
"sync/atomic" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# List all keys stored in memcache. | |
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
require 'net/telnet' | |
headings = %w(id expires bytes cache_key) | |
rows = [] |