We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wanted to test http with ab.
ab -n 1 -c 1 http://localhost:8080/plaintext
using this :
const stringify = require('@stringify') const http = require('@http') const process = require('process') const { createServer, responses } = http const { sjs, attr } = stringify const message = 'Hello, World!' const json = { message } function spawn (main) { if (just.env()['WORKER']) return main() const { watch, launch } = process const processes = [] const cpus = parseInt(just.env().CPUS || just.sys.cpus, 10) for (let i = 0; i < cpus; i++) { just.sys.setenv('WORKER', i) //const proc = launch(just.args[0], ['--trace-gc', ...just.args.slice(1)]) const proc = launch(just.args[0], just.args.slice(1)) processes.push(proc) proc.stats = { user: 0, system: 0 } } return Promise.all(processes.map(p => watch(p))) } class Clock { constructor () { this.slots = new Map() } unset (callback, repeat = 1000) { const current = this.slots.get(repeat) if (!current) return current.callbacks = current.callbacks.filter(cb => cb !== callback) if (!current.callbacks.length) { just.clearTimeout(current.timer) this.slots.delete(repeat) } } set (callback, repeat = 1000) { let current = this.slots.get(repeat) if (current) { current.callbacks.push(callback) return } current = { callbacks: [callback], timer: just.setInterval(() => current.callbacks.forEach(cb => cb()), repeat) } this.slots.set(repeat, current) } } async function main() { const sJSON = sjs({ message: attr('string') }) const server = createServer() .get('/plaintext', res => res.text(message)) .get('/json', res => res.utf8(sJSON(json), responses.json)) .listen('0.0.0.0', 8080) const clock = new Clock() clock.set(() => { server.update() }) } spawn(main) .catch(err => just.error(err.stack))
The text was updated successfully, but these errors were encountered:
@billywhizz ?
Sorry, something went wrong.
I think this is related to limitation of apache benchmark for newer tech : http2 + , websockets
No branches or pull requests
Wanted to test http with ab.
ab -n 1 -c 1 http://localhost:8080/plaintext
using this :
The text was updated successfully, but these errors were encountered: