Skip to content

Commit 0dafb70

Browse files
committed
⚡ ✅ update test
1 parent 1843e4d commit 0dafb70

File tree

5 files changed

+48
-2
lines changed

5 files changed

+48
-2
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,53 @@ npm install
1515
- head request
1616
- Etag+last modified
1717
# test
18-
### first `npm run build` or `yarn build` then copy the `public` folder in `src/test` to `dist/src/test`,and `yarn test` or `npm run test`,now you can visit [http://localhost/](http://localhost/),and you can see the hello world on the screen
18+
### first `npm run build` or `yarn build` then copy the `public` folder in `src/test` to `dist/src/test`,and `yarn test` or `npm run test`,now you can visit [http://localhost/](http://localhost:2333/),and you can see the hello world on the screen
19+
### benchmark results is in the `benchmark` folder
20+
```
21+
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
22+
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
23+
Licensed to The Apache Software Foundation, http://www.apache.org/
24+
25+
Benchmarking localhost (be patient)
26+
27+
28+
Server Software:
29+
Server Hostname: localhost
30+
Server Port: 2333
31+
32+
Document Path: /index.html
33+
Document Length: 228 bytes
34+
35+
Concurrency Level: 10000
36+
Time taken for tests: 27.310 seconds
37+
Complete requests: 100000
38+
Failed requests: 0
39+
Write errors: 0
40+
Total transferred: 46000000 bytes
41+
HTML transferred: 22800000 bytes
42+
Requests per second: 3661.71 [#/sec] (mean)
43+
Time per request: 2730.961 [ms] (mean)
44+
Time per request: 0.273 [ms] (mean, across all concurrent requests)
45+
Transfer rate: 1644.91 [Kbytes/sec] received
46+
47+
Connection Times (ms)
48+
min mean[+/-sd] median max
49+
Connect: 0 957 2202.3 4 15061
50+
Processing: 62 213 175.5 178 6590
51+
Waiting: 8 167 169.4 133 6550
52+
Total: 76 1170 2234.6 225 16126
53+
54+
Percentage of the requests served within a certain time (ms)
55+
50% 225
56+
66% 1143
57+
75% 1200
58+
80% 1240
59+
90% 3187
60+
95% 4209
61+
98% 7277
62+
99% 15288
63+
100% 16126 (longest request)
64+
```
1965
# TODO
2066
- ~~support http range~~ done!
2167
- mapping path

benchmark/benchmark0.txt

56 Bytes
Binary file not shown.

benchmark/benchmark2.txt

56 Bytes
Binary file not shown.

benchmark/benchmark3.txt

56 Bytes
Binary file not shown.

src/test/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import staticServer from '../server/index';
22
import path from 'path';
3-
staticServer(path.resolve(path.normalize(path.join(__dirname, './public'))), { port: 80, host: '0.0.0.0' });
3+
staticServer(path.resolve(path.normalize(path.join(__dirname, './public'))), { port: 2333, host: '0.0.0.0' });

0 commit comments

Comments
 (0)