Skip to content

Commit

Permalink
add qlog-parser tool and update relative document (#437)
Browse files Browse the repository at this point in the history
Co-authored-by: pengfeng <[email protected]>
  • Loading branch information
PFpengfeng and pengfeng authored Jul 9, 2024
1 parent c859573 commit 9746515
Show file tree
Hide file tree
Showing 4 changed files with 1,054 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ XQUIC Library released by Alibaba is …
[![](https://img.shields.io/static/v1?label=draft-13&message=QUIC-LB&color=9cf)](https://tools.ietf.org/html/draft-ietf-quic-load-balancers-13)
[![](https://img.shields.io/static/v1?label=draft-05&message=Multipath-QUIC&color=9cf)](https://tools.ietf.org/html/draft-ietf-quic-multipath-05)
[![](https://img.shields.io/static/v1?label=draft-06&message=Multipath-QUIC&color=9cf)](https://tools.ietf.org/html/draft-ietf-quic-multipath-06)
[![](https://img.shields.io/static/v1?label=draft-07&message=QUIC-Qlog&color=9cf)](https://datatracker.ietf.org/doc/html/draft-ietf-quic-qlog-main-schema-07)

#### Standardized Features

Expand Down Expand Up @@ -156,7 +157,7 @@ sh ../scripts/xquic_test.sh
- [draft-ietf-quic-qpack-21-zh](./docs/translation/draft-ietf-quic-qpack-21-zh.md)
- [RFC9221-datagram-zh](./docs/translation/rfc9221-datagram-zh.md)

* For using event_log module, see the [Event_log module docs](./docs/docs-zh/Event_log-zh.md)
* For using quic-qlog, see the [Features: qlog](./docs/Features.md)
* For testing the library, see the [Testing docs](./docs/docs-zh/Testing-zh.md).
* For other frequently asked questions, see the [FAQs](./docs/docs-zh/FAQ-zh.md) and [Trouble Shooting Guide](./docs/docs-zh/Troubleshooting-zh.md).

Expand Down
34 changes: 34 additions & 0 deletions docs/Features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Features
## qlog
Based on qlog ([draft-ietf-quic-qlog-main-schema](https://datatracker.ietf.org/doc/draft-ietf-quic-qlog-main-schema/), [draft-ietf-quic-qlog-quic-events](https://datatracker.ietf.org/doc/draft-ietf-quic-qlog-quic-events/) and [draft-ietf-quic-qlog-h3-events](https://datatracker.ietf.org/doc/draft-ietf-quic-qlog-h3-events/)),xquic implements quic event logging.

### Activate qlog by DXQC_ENABLE_EVENT_LOG
```shell
cd build
rm -rf *
# add "-DXQC_ENABLE_EVENT_LOG=1"
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} ..

make -j
```
### Example
Qlog defines three event importance levels, in decreasing order of importance and expected usage: core, base, extra. The level can be set by "--qlog_importance" argument:
```shell
./tests/test_server -l e -e --qlog_importance extra

./tests/test_client -s 10240 -l e -t 1 -E --qlog_importance extra
```

To disable qlog, using "--qlog_disable":
```shell
./tests/test_server -l e -e --qlog_disable

./tests/test_client -s 10240 -l e -t 1 -E --qlog_disable
```

### JSON format serialization
```shell
python ../scripts/qlog_parser.py --clog clog --slog slog --qlog_path demo_qlog.json
```


34 changes: 34 additions & 0 deletions docs/docs-zh/Features-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Features
## qlog
基于 qlog ([draft-ietf-quic-qlog-main-schema](https://datatracker.ietf.org/doc/draft-ietf-quic-qlog-main-schema/)[draft-ietf-quic-qlog-quic-events](https://datatracker.ietf.org/doc/draft-ietf-quic-qlog-quic-events/)[draft-ietf-quic-qlog-h3-events](https://datatracker.ietf.org/doc/draft-ietf-quic-qlog-h3-events/)),xquic 实现了 quic 事件记录。
### 编译参数 DXQC_ENABLE_EVENT_LOG 开启 qlog
```shell
cd build
rm -rf *
# 添加 "-DXQC_ENABLE_EVENT_LOG=1" 参数
cmake -DGCOV=on -DCMAKE_BUILD_TYPE=Debug -DXQC_ENABLE_TESTING=1 -DXQC_SUPPORT_SENDMMSG_BUILD=1 -DXQC_ENABLE_EVENT_LOG=1 -DXQC_ENABLE_BBR2=1 -DXQC_ENABLE_RENO=1 -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} ..

make -j
```
### 运行测试
按重要性,qlog 将事件分为 core、base、extra 三个 importance level,可以通过 --qlog_importance 设置:
```shell
./tests/test_server -l e -e --qlog_importance extra

./tests/test_client -s 10240 -l e -t 1 -E --qlog_importance extra
```

通过 --qlog_disable 关闭 qlog:
```shell
./tests/test_server -l e -e --qlog_disable

./tests/test_client -s 10240 -l e -t 1 -E --qlog_disable
```

### JSON 格式转换
执行 qlog_parser.py 脚本工具,将 xquic log 转换 json 格式 qlog.
```shell
python ../scripts/qlog_parser.py --clog clog --slog slog --qlog_path demo_qlog.json
```


Loading

0 comments on commit 9746515

Please sign in to comment.