| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,11 +40,11 @@ function main({ dur, type, size }) { | |||
| 40 | 40 | }; | |
| 41 | 41 | ||
| 42 | 42 | server = tls.createServer(options, onConnection); | |
| 43 | - setTimeout(done, dur * 1000); | ||
| 44 | 43 | var conn; | |
| 45 | 44 | server.listen(common.PORT, function() { | |
| 46 | 45 | const opt = { port: common.PORT, rejectUnauthorized: false }; | |
| 47 | 46 | conn = tls.connect(opt, function() { | |
| 47 | + setTimeout(done, dur * 1000); | ||
| 48 | 48 | bench.start(); | |
| 49 | 49 | conn.on('drain', write); | |
| 50 | 50 | write(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,25 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + | ||
| 3 | + const common = require('../common'); | ||
| 4 | + | ||
| 5 | + if (!common.enoughTestMem) | ||
| 6 | + common.skip('Insufficient memory for TLS benchmark test'); | ||
| 7 | + | ||
| 8 | + // Because the TLS benchmarks use hardcoded ports, this should be in sequential | ||
| 9 | + // rather than parallel to make sure it does not conflict with tests that choose | ||
| 10 | + // random available ports. | ||
| 11 | + | ||
| 12 | + const runBenchmark = require('../common/benchmark'); | ||
| 13 | + | ||
| 14 | + runBenchmark('tls', | ||
| 15 | + [ | ||
| 16 | + 'concurrency=1', | ||
| 17 | + 'dur=0.1', | ||
| 18 | + 'n=1', | ||
| 19 | + 'size=2', | ||
| 20 | + 'type=asc' | ||
| 21 | + ], | ||
| 22 | + { | ||
| 23 | + NODEJS_BENCHMARK_ZERO_ALLOWED: 1, | ||
| 24 | + duration: 0 | ||
| 25 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments