Skip to content

Commit ff69ef4

Browse files
committed
DOC: add request latency to README
1 parent ccfa811 commit ff69ef4

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,43 @@ $ tcpkit -i eth0 tcp port 6379 -p redis -S scripts/example.lua
6363
6464
the callback function `function process(packet)` in `scripts/example.lua` would be triggered if new packets reached.
6565
66-
## Predefine Scripts
66+
### Predefine Scripts
6767
6868
1. [exmaple.lua](https://github.com/git-hulk/tcpkit/blob/master/scripts/example.lua) - example for user defined script
6969
2. [dns.lua](https://github.com/git-hulk/tcpkit/blob/master/scripts/dns.lua) - print the dns latency
7070
3. [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
74105
tcpkit is under the MIT license. See the LICENSE file for details.

0 commit comments

Comments
 (0)