File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed
Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,43 @@ $ tcpkit -i eth0 tcp port 6379 -p redis -S scripts/example.lua
6363
6464the callback function `function process(packet)` in ` scripts/example.lua` would be triggered if new packets reached.
6565
66- # # Predefine Scripts
66+ # ## Predefine Scripts
6767
68681. [exmaple.lua](https://github.com/git-hulk/tcpkit/blob/master/scripts/example.lua) - example for user defined script
69692. [dns.lua](https://github.com/git-hulk/tcpkit/blob/master/scripts/dns.lua) - print the dns latency
70703. [tcp-connnect.lua](https://github.com/git-hulk/tcpkit/blob/master/scripts/tcp-connect.lua) - print connection with syn packet retransmit
7171
72+ # # Request Latency
73+
74+ the stats port listen on ` 33333` by default, use the ` -P` to change the listen port.
75+
76+ ` ` ` json
77+ ➜ ~ telnet 127.0.0.1 33333
78+ Trying 127.0.0.1...
79+ Connected to localhost.
80+ Escape character is ' ^]' .
81+
82+ {
83+ " 127.0.0.1:6379" : {
84+ " requests" : 1700,
85+ " request_bytes" : 184100,
86+ " responses" : 1700,
87+ " response_bytes" : 1413764,
88+ " latency" : [{
89+ " <0.1ms" : 326
90+ }, {
91+ " 0.1ms~0.2ms" : 371
92+ }, {
93+ " 0.2~0.5ms" : 589
94+ }, {
95+ " 0.5ms~1ms" : 291
96+ }, {
97+ " 1ms~5ms" : 123
98+ }]
99+ }
100+ }
101+ ` ` `
102+
72103# # License
73104
74105tcpkit is under the MIT license. See the LICENSE file for details.
You can’t perform that action at this time.
0 commit comments