Skip to content

Instantly share code, notes, and snippets.

View robingustafsson's full-sized avatar

Robin Gustafsson robingustafsson

View GitHub Profile
@robingustafsson
robingustafsson / random-controller.jmx
Created January 25, 2019 14:47
JMeter-to-k6 PR review: Random Controller
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.0 r1840935">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
@robingustafsson
robingustafsson / json-path-extractor.jmx
Created January 25, 2019 14:46
JMeter-to-k6 PR review: JSON path extractor
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.0 r1840935">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
@robingustafsson
robingustafsson / empty.jmx
Created January 25, 2019 14:40
JMeter-to-k6 PR review: Empty test plan
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.0 r1840935">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
@robingustafsson
robingustafsson / k6_CLA.md
Last active July 16, 2019 21:17
Contributor License Agreement for Load Impact k6

LOAD IMPACT, k6 Contributor License Agreement

Thank you for your interest in contributing to Load Impact and our load and performance testing tool k6 (”the Software”). This contributor agreement ("Agreement") documents the rights granted by contributors to the Software. To make this Agreement effective, please sign it following the instructions at cla-assistant. This is a legally binding document, so please read it carefully before agreeing to it. The Agreement may cover more than one software project managed by Load Impact.

1. Definitions

"You" (Individual) means the individual who Submits a Contribution to Load Impact.

"You" (Entity) means any Legal Entity on behalf of whom a Contribution has been received by Load Impact. "Legal Entity" means an entity which is not a natural person. "Affiliates" means other Legal Entities that control, are controlled by, or under common control with that Legal Entity. For the purposes of this definition, "co

@robingustafsson
robingustafsson / main.js
Created February 22, 2018 11:01
k6 modules example
import { check, group, sleep } from "k6";
import http from "k6/http";
import { options as optionsFeaturesPage, pageOptions as pageOptionsFeaturesPage, testFeaturesPage } from "./units/features.js";
import { options as optionsIndexPage, pageOptions as pageOptionsIndexPage, testIndexPage } from "./units/index.js";
import { options as optionsPricingPage, pageOptions as pageOptionsPricingPage, testPricingPage } from "./units/pricing.js";
// Options
export let options = {
stages: [
@robingustafsson
robingustafsson / jwt.js
Created October 14, 2017 20:16
Simple JWT example for k6 load testing tool
import crypto from "k6/crypto";
import encoding from "k6/encoding";
const algToHash = {
HS256: "sha256",
HS384: "sha384",
HS512: "sha512"
};
function sign(data, hashAlg, secret) {