diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..c91e32b --- /dev/null +++ b/docs/README.md @@ -0,0 +1,149 @@ +# 这里是`Request Counter`的文档 +虽然说项目很小根本不需要文档 + +## 部署到本地服务器 + ```shell + $ git clone https://git@github.com:MarkusJoe/RequestCounter.git + $ cd RequestCounter + $ pip3 install -r requirements.txt + $ python3 app.py + ``` + +> 程序还支持自定义图片的大小需要在`./bin/core/length.py` 中修改 `make_html`函数的参数 + +### 基本信息 +- Python版本: `3.9.9` +- 请求方法: `GET` `POST` +- 请求地址: `/API` +- 请求参数: `name` : `str` + - 可选参数: `length` : `int` + - 可选参数: `theme` : `str` + + +### 注意事项 +- Python版能最新版就最新版 +- 项目使用了标准库`Sqlite3`进行了数据库操作某些免费部署的服务器可能不支持 + + +### 开源 +- 本项目以Apache-2.0许可开源, 即: + - 你可以直接使用该项目提供的功能, 无需任何授权 + - 你可以在**注明来源版权信息**的情况下对源代码进行任意分发和修改以及衍生 + + +### 快速响应: +```python +import requests + +for i in range(100): + res = requests.get('http://127.0.0.1/API?name=2&length=10&theme=t2').elapsed.microseconds + print(res) # 返回响应速度 单位: 微秒 +``` +>在`AMD Athlon(tm) X4 830 Quad Core Processor 2.99 GHz` `4G` 内存的电脑上运行项目 +> 在本机上使用`Requests`库`GET`方法请求`100`次 (名称为`2`长度为`10`主题为`t2`) +> 使用`elapsed.microseconds`属性 获取响应速度返回的值如下 +
+单位: 微秒
+参考: 1秒(second)(s) = 1000毫秒(millisecond)(ms) = 1000000微秒(microseconds)(us)
+61764
+22125
+25059
+16524
+13396
+12787
+20579
+18987
+25500
+14910
+11303
+11787
+16949
+17094
+15264
+10934
+10526
+11943
+16967
+17205
+12887
+11386
+11547
+17743
+18625
+17208
+14763
+12858
+12708
+18598
+16879
+16216
+14655
+12089
+11588
+17287
+20115
+14403
+12857
+11596
+15006
+18246
+18013
+13623
+10673
+12064
+17838
+16651
+16483
+13522
+13231
+15624
+11043
+10765
+16317
+17200
+13250
+11230
+11533
+16727
+16781
+16253
+14658
+13762
+13194
+17700
+17933
+15686
+12051
+10904
+17163
+16591
+16464
+15271
+12405
+17173
+26737
+15964
+12363
+12653
+12893
+17524
+20084
+14165
+12037
+13427
+17245
+18652
+18438
+14811
+14233
+14555
+17998
+16949
+16445
+12120
+11695
+14257
+17557
+16587
+
+