Skip to content

Instantly share code, notes, and snippets.

var assert = require('assert');
//Define your authentication credentials
//get + format date
function timestamper(daysToAdd) {
var someDate = new Date();
var numberOfDaysToAdd = 5;
someDate.setDate(someDate.getDate() + daysToAdd);
//Define your authentication credentials
//get + format date
function timestamper(daysToAdd) {
var someDate = new Date();
var numberOfDaysToAdd = 5;
someDate.setDate(someDate.getDate() + daysToAdd);
var dd = someDate.getDate();
var nr_monitor_ads = function(){
var convertToString = ['advertiserId', 'campaignId', 'creativeId', 'lineItemId', 'labelIds', 'sourceAgnosticCreativeId', 'sourceAgnosticLineItemId'];
var NR_SUBMIT_PAGE_ACTION = function(ev, obj) {
if (typeof window.newrelic != 'undefined' && typeof window.newrelic.addPageAction == 'function') {
for (i in obj) {
if (convertToString.indexOf(i) > -1) {
obj[i] = String(obj[i]);
}
}
window.newrelic.addPageAction(ev, obj)
// anomaly detection based on Median Absolute Deviation estimates of
// standard deviation (robust to outliers and non-normal data)
//
import 'https://gist.githubusercontent.com/welch/3f7b696beab6ba1b55bb/raw/stdj.juttle' as stdj;
import 'https://gist.githubusercontent.com/welch/3f7b696beab6ba1b55bb/raw/math.juttle' as math;
import 'https://gist.githubusercontent.com/welch/3f7b696beab6ba1b55bb/raw/ts.juttle' as ts;
import 'https://gist.githubusercontent.com/welch/3f7b696beab6ba1b55bb/raw/mav.juttle' as mav;
import 'https://gist.githubusercontent.com/welch/3f7b696beab6ba1b55bb/raw/seasonal.juttle' as seasonal;
import 'https://gist.githubusercontent.com/welch/3f7b696beab6ba1b55bb/raw/forecast.juttle' as forecast;
// ts -- juttle timeseries utilities
//
import 'https://gist.githubusercontent.com/welch/3f7b696beab6ba1b55bb/raw/stdj.juttle' as stdj;
//
// downsample: thin a series of values by retaining its extreme values over successive intervals
// parameters:
// in -- name of value field
// every -- interval of each downsample
//
export sub downsample(in, every) {