Skip to content

Instantly share code, notes, and snippets.

View ppcano's full-sized avatar

Pepe Cano ppcano

View GitHub Profile
for (i = 0; i < inputFiles.length; i++) {
if (fs.lstatSync(srcDir + '/' + inputFiles[i]).isFile()) {
addFile(inputFiles[i])
}
}
@ppcano
ppcano / Assetfile.rb
Last active November 11, 2023 06:42
Precompile handlebars templates with rake-pipeline
input "app" do
match "templates/**/*.handlebars" do
filter HandlebarsPrecompiler
filter ConcatFilter, "apptmp.js"
filter AddMicroLoader, :global => true
filter AddHandlebarsDependencies
end
import http from "k6/http";
import {group} from "k6";
import { Counter } from "k6/metrics";
//adding these metrics to count each group execution
var group1Counter = new Counter("counter_group1");
var group2Counter = new Counter("counter_group2");
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember - Workaround to yield multiple blocks'
});
@ppcano
ppcano / script.js
Last active February 12, 2020 10:33
import { check, sleep } from 'k6';
import http from 'k6/http';
export let options = {
vus: 50,
duration: "3s"
};
export default function() {
let res = http.get("https://test.k6.io/");
@ppcano
ppcano / footer.md
Last active January 29, 2020 11:24
import { check, sleep } from 'k6';
import http from 'k6/http';
export let options = {
duration: "1m",
vus: 100
}
export default function() {
let res;
import { sleep } from "k6";
import http from "k6/http";
export let options = {
duration: "1m",
vus: 50,
thresholds: {
http_req_duration: ["p(95)<500"]
}
};
@ppcano
ppcano / my-performance-test.js
Created October 4, 2019 11:39
Performance test example
import http from "k6/http";
import { sleep } from "k6";
export let options = {
duration: '45s',
thresholds: {
"http_req_duration": ["p(99)<500"]
}
};
import {sleep} from "k6";
import mainPageUserFlow from "../cases/main-page";
import billingUserFlow from "../cases/billing";
export let options = {
thresholds: {
"group_duration{group:::mainPageGroup}": ["p(99)<300"],
"group_duration{group:::billingGroup}": ["p(99)<300"]
}
};