Skip to content

Instantly share code, notes, and snippets.

View hassy's full-sized avatar
🐢
Working through a massive backlog of issues, PRs and emails. Send coffee.

Hassy Veldstra hassy

🐢
Working through a massive backlog of issues, PRs and emails. Send coffee.
View GitHub Profile
@hassy
hassy / soda-social-5.md
Created July 27, 2016 15:15
soda social 5

What can be traced

  • S3 putObject and uploadFile
  • Invoking other lambdas
  • Publishing to SNS topics
  • Custom actions (e.g. write to Neo4J)

Sampling

By default only 10% of traced actions actually get logged.

@hassy
hassy / soda-social-4.md
Last active February 1, 2018 11:15
soda social 4

How it works

SNS and S3 notifications are easy

Lambda activity - not quite so

Solution: monkey-patch aws-sdk 🙈

@hassy
hassy / soda-social-3.md
Last active February 1, 2018 11:15
soda social 3

What we wanted

To recap:

  • 20 lambdas
  • 10 SNS topics (more than one subscriber/publisher for some)
  • S3 buckets (triggering lambdas)
@hassy
hassy / soda-social-2.md
Last active February 1, 2018 11:15
soda social 2

AWS API Gateway

aws api gateway

GraphQL

graphql

Lambda

@hassy
hassy / test.yml
Created July 20, 2016 20:11
Artillery - short duration
config:
target: "http://localhost:3003"
phases:
- duration: 1
arrivalRate: 1
scenarios:
- flow:
- get:
url: "/"
- get:
- post:
url: "/some/url"
formData:
firstName: "Jerry"
lastName: "Winston"
headers:
authorization: "Bearer {{access_token}}"
@hassy
hassy / lambda.js
Last active September 19, 2022 17:20
Different behavior of context.succeed() vs callback() in AWS Lambda
//
// Lambda's timeout needs to be >5 seconds, 10 should do
//
var startedAt = new Date();
var interval = setInterval(function () {
console.log(startedAt, new Date());
}, 1000);
@hassy
hassy / my-test.yml
Created March 31, 2016 20:17
Example of using processors in Artillery
config:
target: "http://localhost:8080"
phases:
- duration: 60
arrivalRate: 1
processor: "./processor.js"
scenarios:
- name: "Load the options page"
flow:
- get:
@hassy
hassy / loop.json
Last active November 5, 2019 19:01
Artillery `loop` example
{
"config": {
"target": "http://localhost",
"phases": [
{"duration": 10, "arrivalRate": 20}
]
},
"scenarios": [
{
"flow": [
node server.js
# npm install artillery
./node_modules/.bin/artillery run large_payload.json