This file contains hidden or 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
// gulp/tasks/perf.js | |
import {task as perfTask} from '@hfa/perf' | |
export default perfTask(/* any options */) | |
// perf.config.js | |
export default { | |
name: string // SpeedCurve project name | |
page: string // Page to test | |
env: string // "dev" or "prod" |
This file contains hidden or 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
gen @hfa/perf # generate a perf.config.js file in project root | |
@hfa/perf --page /bleep # run SpeedCurve tests against /bleep route for your project | |
@hfa/perf --env dev --page * # run SpeedCurve tests for all pages on "dev" | |
@hfa/perf --env prod --page * # run SpeedCurve tests for all pages on "prod" |
This file contains hidden or 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
import path from 'path'; | |
import glob from 'globby'; | |
import {readJson, outputJson} from 'fs-extra'; | |
const cwd = process.cwd(); | |
const read = (fp) => { | |
return new Promise((res, rej) => { | |
readJson(fp, (err, data) => { | |
if (err) return rej(err); |
This file contains hidden or 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
const flatten = (() => { | |
function flatten(arr, list) { | |
if (Array.isArray(arr)) { | |
arr.forEach(item => flatten(item, list)) | |
} else { | |
list.push(arr) | |
} | |
return list | |
} |
This file contains hidden or 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
// function run(gen) { | |
// const it = gen() | |
// return new Promise((res, rej) => { | |
// function next(err, data) { | |
// let nextData; | |
// if (err !== undefined && err !== null) { | |
// nextData = it.throw(err) | |
// } else { |
This file contains hidden or 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
# i-27794fa1 | |
https://docs.google.com/a/hillaryclinton.com/document/d/1Ofo4XOQAoKZozq9yS3p62xmh-kf18d0HVITVwn_jys8/edit?usp=sharing | |
---------------4 workers on 4 cores----------------------- | |
▶ wrk -c 50 -t 2 -d 1m -R 50 http://10.4.111.156/ | |
Running 1m test @ http://10.4.111.156/ | |
2 threads and 50 connections | |
Thread calibration: mean lat.: 5535.371ms, rate sampling interval: 12836ms | |
Thread calibration: mean lat.: 5376.000ms, rate sampling interval: 19415ms |
This file contains hidden or 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
Mocha { | |
files: [ '/Users/davidfox-powell/dev/sos-server/test/unit/server-middleware-spec.js' ], | |
options: { reporterOptions: {}, globals: [] }, | |
suite: | |
Suite { | |
title: '', | |
ctx: {}, | |
suites: [], | |
tests: [], | |
pending: false, |
This file contains hidden or 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
Mocha { | |
files: [ '/Users/davidfox-powell/dev/sos-server/test/unit/server-middleware-spec.js' ], | |
options: { reporterOptions: {}, globals: [] }, | |
suite: | |
Suite { | |
title: '', | |
ctx: {}, | |
suites: [], | |
tests: [], | |
pending: false, |
This file contains hidden or 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
import {isJSON} from '../utils/is-json'; | |
import request from './superagent'; | |
export async function({method = 'GET', url}) { | |
method = method.toUpperCase(); | |
const methods = ['GET', 'POST']; | |
let [foundMethod] = methods.filter(m => method === m); | |
if (!foundMethod) { | |
throw new Error('you specified an unknown method') |
This file contains hidden or 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
import reactor from '../modules/bootstrap'; | |
import serverMod from '@hfa/sos-server/lib/modules/server'; | |
import formMetaMod from '../modules/form-meta'; | |
import {Getters as FormGetters, makeActions as makeFormActions} from '@hfa/form-components'; | |
import {analytics} from '../config'; | |
import {isFunction} from '../utils/lodash'; | |
class BootStrap { | |
constructor() { | |
const {_reactor = '{}'} = global.hfaGlobals || {}; |