# Configure terraform
terraform {
required_version = "~> 0.14.0"
required_providers {
newrelic = {
source = "newrelic/newrelic"
version = "~> 2.9.0"
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
DCL VAR(&RESPONSE) TYPE(*CHAR) LEN(2000) | |
DCL VAR(&ERROR) TYPE(*CHAR) LEN(2000) | |
CALL PGM(SYSTOOLS/HTTPPOST) | |
PARM('https://api.twilio.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Messages.json' | |
'From=+1234567890&To=+0987654321&Body=Hello+from+AS400' | |
'Authorization: Basic BASE64ENCODED_AUTH_TOKEN' &RESPONSE &ERROR) |
Thanks for attending todays webinar by Simon (@0x12b) and Gary (@gspncr). If you have questions you can use the k6 community or the New Relic Explorers Hub and tag us.
Here are some of the assets we presented or mean to distribute:
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
exports.handler = async (context, event, callback) => { | |
// Providing a string will result in a 200 OK | |
var location = event.location.toLowerCase(); | |
console.log('hello'); | |
const TWILIO_SYNC_SERVICE_SID = 'ISxxx' | |
const TWILIO_MAP_SID = 'MPxxx' | |
const syncClient = Runtime.getSync({ serviceName: TWILIO_SYNC_SERVICE_SID}); | |
var enteredLocation = await syncClient |
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
TWILIO_ACCOUNT_SID=ACxxxxxxxxxx | |
TWILIO_AUTH_TOKEN=xxxxxxxxx |
Assumptions: a New Relic account and Ubuntu 18. Works on a t2.micro
k6 installation instructions from their docs
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61
echo "deb https://dl.bintray.com/loadimpact/deb stable main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install k6
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
// calculate the delta between the date you provide as an arg and the year of the current day. | |
// Provide it 01/01/2000 and you run this on 12/12/2020, this will return 20 | |
exports.handler = function(context, event, callback) { | |
function formatDate(date){ | |
var d = new Date(date), month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear(); | |
if (month.length < 2) month = '0' + month; | |
if (day.length < 2) day = '0' + day; | |
console.log(year) |
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
{% assign bday = "1993-09-05" %} | |
{{ bday | date: "%Y" }} | |
{{'now' | date: '%Y' }} | |
{% assign today = 'now' | date: '%Y' %} | |
{% assign birthYear = bday | date: '%Y' %} | |
{{today}} | |
{{birthYear}} | |
{{today | minus: birthYear }} |
Lines 24-27 are doing the filtering per docs
# my global config
global:
scrape_interval: 60s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 60s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
NewerOlder