Skip to content

Instantly share code, notes, and snippets.

View postwait's full-sized avatar

Theo Schlossnagle postwait

View GitHub Profile
#!/opt/circonus/bin/luamtev -L+/opt/circonus/share/lua/5.1/?.lua;/opt/circonus/share/lua/5.1/?/init.lua
module(..., package.seeall)
function calc_next(last, period)
if not last then last = mtev.timeval.now() end
local ne = last:seconds() + period
return mtev.timeval.new(math.floor(ne), math.floor((ne - math.floor(ne)) * 1000000))
end
/*
* Copyright (c) 2020, Circonus, Inc.
* All rights reserved.
*/
#ifndef SNOWTH_UTIL_MTEV_MEMORY_SAFE_OBJECT_HPP
#define SNOWTH_UTIL_MTEV_MEMORY_SAFE_OBJECT_HPP
#include <mtev_memory.h>
DISPLACE=../
MODULES=prometheus.$(MODULEEXT)
include ../Makefile
LIBS=-lsnappyc -lnoit
OBJS=prometheus.mo prometheus.pb-c.mo types.pb-c.mo
### Prometheus Ingress Module
prometheus.mo: prometheus.c prometheus.xmlh
prometheus.pb-c.mo: prometheus.pb-c.c
.SUFFIXES: .c .cpp .lo .mo .xml .xmlh
Q=
ifeq ($(V),)
Q=@
endif
MAKE?=gmake
DISPLACE?=../
CC=@CC@
diff --git a/src/datasource.ts b/src/datasource.ts
index 25e4427..e5aa5df 100644
--- a/src/datasource.ts
+++ b/src/datasource.ts
@@ -126,12 +126,14 @@ export default class IrondbDatasource {
headers['X-Circonus-App-Name'] = this.appName;
}
if ('standalone' == this.irondbType && !isCaql) {
+ headers['X-Circonus-Account'] = this.accountId;
baseUrl = baseUrl + '/graphite/' + this.accountId;
#!/bin/bash
SECONDS=5
bail() {
echo "Error: $@"
exit 1
}
DIR=`mktemp -d`
cd $DIR || bail "temp directory failure"
Version: 17.12.0-ce-win46 (15048)
Channel: stable
Sha1: 0ac7325e4f480d6458b9d4ef12b50d8fcf782fae
Started on: 2018/01/09 17:15:42.081
Resources: C:\Program Files\Docker\Docker\Resources
OS: Windows 10 Enterprise Insider Preview
Edition: Professional
Id: 1709
Build: 17063
BuildLabName: 17063.1000.amd64fre.rs_prerelease.171213-1610
@postwait
postwait / hex.js
Created October 30, 2017 19:35 — forked from valentinkostadinov/hex.js
JavaScript HEX encoding
function toHex(s) {
// utf8 to latin1
var s = unescape(encodeURIComponent(s))
var h = ''
for (var i = 0; i < s.length; i++) {
h += s.charCodeAt(i).toString(16)
}
return h
}
# Description:
# interacts with the Sparkpost reporting API.
#
# Dependencies:
# None
#
# Configuration:
# HUBOT_SPARKPOST_API_TOKEN your API token with reporting privileges
# HUBOT_SPARKPOST_TIMEZONE the timezone (default America/New_York)
#
#!/usr/bin/python
# This program was created as a modification to Brendan Gregg's
# biolatency script.
from __future__ import print_function
from bcc import BPF
from time import sleep, strftime
import argparse
# arguments
examples = """examples: