SylviaBABY commented on code in PR #7930:
URL: https://github.com/apache/apisix/pull/7930#discussion_r973809312


##########
docs/zh/latest/plugins/limit-count.md:
##########
@@ -1,5 +1,10 @@
 ---
 title: limit-count
+keywords:
+  - APISIX
+  - API 网关
+  - Limit Count

Review Comment:
   ```suggestion
     - Limit Count
     - 速率限制
   ```



##########
docs/zh/latest/plugins/limit-count.md:
##########
@@ -23,39 +28,37 @@ title: limit-count
 
 ## 描述
 
-和 [GitHub API 的限速](https://docs.github.com/en/rest/reference/rate-limit) 类似,
-在指定的时间范围内,限制总的请求个数。并且在 HTTP 响应头中返回剩余可以请求的个数。
+和 [GitHub API 
的限速](https://docs.github.com/en/rest/reference/rate-limit)类似,`limit-count` 
插件用于限制客户端在指定的时间范围内对服务的总请求数,并且在 HTTP 响应头中返回剩余可以请求的个数。
 
 ## 属性
 
 | 名称                | 类型    | 必选项                               | 默认值        | 
有效值                                                                             
                     | 描述                                                       
                                                                                
                                                                                
                                                                                
                                                                                
                           |
 | ------------------- | ------- | --------------------------------- | 
------------- | 
-------------------------------------------------------------------------------------------------------
 | 
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 |
-| count               | integer | 必须                               |           
    | count > 0                                                                 
                              | 指定时间窗口内的请求数量阈值                                  
                                                                                
                                                                                
                                                                                
                                                                                
                        |
-| time_window         | integer | 必须                               |           
    | time_window > 0                                                           
                              | 时间窗口的大小(以秒为单位),超过这个时间就会重置                       
                                                                                
                                                                                
                                                                                
                                                                                
             |
-| key_type      | string | 可选   |  "var"      | ["var", "var_combination", 
"constant"]                                          | key 的类型 |
-| key           | string  | 可选   |    "remote_addr"    |  | 用来做请求计数的依据。如果 
`key_type` 为 "constant",那么 key 会被当作常量。如果 `key_type` 为 "var",那么 key 会被当作变量名称。如果 
`key_type` 为 "var_combination",那么 key 会当作变量组。比如如果设置 "$remote_addr 
$consumer_name" 作为 key,那么插件会同时受 remote_addr 和 consumer_name 两个变量的约束。如果 key 
的值为空,$remote_addr 会被作为默认 key。 |
-| rejected_code       | integer | 可选                               | 503       
    | [200,...,599]                                                             
                              | 当请求超过阈值被拒绝时,返回的 HTTP 状态码                        
                                                                                
                                                                                
                                                                                
                                                                                
                    |
-| rejected_msg       | string | 可选                                |            
| 非空                                                                            
               | 当请求超过阈值被拒绝时,返回的响应体。                                            
                                                                                
                                                                                
 |
-| policy              | string  | 可选                               | "local"   
    | ["local", "redis", "redis-cluster"]                                       
                              | 
用于检索和增加限制的速率限制策略。可选的值有:`local`(计数器被以内存方式保存在节点本地,默认选项) 和 `redis`(计数器保存在 Redis 
服务节点上,从而可以跨节点共享结果,通常用它来完成全局限速);以及`redis-cluster`,跟 redis 功能一样,只是使用 redis 集群方式。  
                                                                                
                                                                      |
-| allow_degradation              | boolean  | 可选                               
 | false       |                                                                
     | 当限流插件功能临时不可用时(例如,Redis 超时)是否允许请求继续。当值设置为 true 时则自动允许请求继续,默认值是 false。|
-| show_limit_quota_header              | boolean  | 可选                         
       | true       |                                                           
          | 是否在响应头中显示 `X-RateLimit-Limit` 和 
`X-RateLimit-Remaining`(限制的总请求数和剩余还可以发送的请求数),默认值是 true。 |
-| group               | string | 可选                                |           
 | 非空                                                                           
                | 配置同样的 group 的 Route 将共享同样的限流计数器 |
-| redis_host          | string  | `redis` 必须                       |           
    |                                                                           
                              | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点的地址。           
                                                                                
                                                                                
                                                                                
                                                                                
                 |
-| redis_port          | integer | 可选                               | 6379      
    | [1,...]                                                                   
                              | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点的端口            
                                                                                
                                                                                
                                                                                
                                                                                
                  |
-| redis_password      | string  | 可选                               |           
    |                                                                           
                              | 当使用 `redis`  或者 `redis-cluster`  限速策略时,该属性是 
Redis 服务节点的密码。                                                                  
                                                                                
                                                                                
                                                                                
                                          |
-| redis_database      | integer | 可选                               | 0         
    | redis_database >= 0                                                       
                              | 当使用 `redis` 限速策略时,该属性是 Redis 服务节点中使用的 
database,并且只针对非 Redis 集群模式(单实例模式或者提供单入口的 Redis 公有云服务)生效。                        
                                                                                
                                                                                
                                                                         |
-| redis_timeout       | integer | 可选                               | 1000      
    | [1,...]                                                                   
                              | 当使用 `redis` 或者 `redis-cluster` 限速策略时,该属性是 Redis 
服务节点以毫秒为单位的超时时间                                                                 
                                                                                
                                                                                
                                                                                
                             |
-| redis_cluster_nodes | array   | 当 policy 为 `redis-cluster` 时必填 |             
  |                                                                             
                            | 当使用 `redis-cluster` 限速策略时,该属性是 Redis 
集群服务节点的地址列表(至少需要两个地址)。                                                          
                                                                                
                                                                                
                                                                                
                                  |
-| redis_cluster_name  | string  | 当 policy 为 `redis-cluster` 时必填 |             
  |                                                                             
                            | 当使用 `redis-cluster` 限速策略时,该属性是 Redis 集群服务节点的名称。   
                                                                                
                                                                                
                                                                                
                                                                                
         |
-
-## 如何使用
-
-### 开启插件
-
-下面是一个示例,在指定的 `route` 上开启了 `limit count` 插件,并设置 `key_type` 为 `var`:
+| count               | integer | 是                               |            
   | count > 0                                                                  
                             | 指定时间窗口内的请求数量阈值。                                  
                                                                                
                                                                                
                                                                                
                                                                                
                        |
+| time_window         | integer | 是                               |            
   | time_window > 0                                                            
                             | 时间窗口的大小(以秒为单位),超过这个时间就会重置。                       
                                                                                
                                                                                
                                                                                
                                                                                
             |
+| key_type      | string | 否   |  "var"      | ["var", "var_combination", 
"constant"]                                          | key 的类型。 |
+| key           | string  | 否   |    "remote_addr"    |  | 用来做请求计数的依据。如果 
`key_type` 为 `constant`,那么 key 会被当作常量;如果 `key_type` 为 `var`,那么 key 会被当作变量;如果 
`key_type` 为 `var_combination`,那么 key 会被当作变量组合,如 `$remote_addr 
$consumer_name`,插件会同时受 `$remote_addr` 和 `$consumer_name` 两个变量的约束;如果 key 
的值为空,`$remote_addr` 会被作为默认 key。 |
+| rejected_code       | integer | 否                               | 503        
   | [200,...,599]                                                              
                             | 当请求超过阈值被拒绝时,返回的 HTTP 状态码。                        
                                                                                
                                                                                
                                                                                
                                                                                
                    |
+| rejected_msg       | string | 否                                |            
| 非空                                                                            
               | 当请求超过阈值被拒绝时,返回的响应体。                                            
                                                                                
                                                                                
 |
+| policy              | string  | 否                               | "local"    
   | ["local", "redis", "redis-cluster"]                                        
                             | 用于检索和增加限制的速率限制策略。当设置为 `local` 
时,计数器被以内存方式保存在节点本地;当设置为 `redis` 时,计数器保存在 Redis 
服务节点上,从而可以跨节点共享结果,通常用它来完成全局限速;当设置为 `redis-cluster` 时,使用 Redis 集群而不是单个实例。        
                                                                                
                                                                |
+| allow_degradation              | boolean  | 否                                
| false       |                                                                 
    | 当设置为 `true` 时,当插件功能临时不可用时(如 Redis 超时),使插件降级并允许请求继续。 |

Review Comment:
   ```suggestion
   | allow_degradation              | boolean  | 否                              
  | false       |                                                               
      | 当插件功能临时不可用时(如 Redis 超时),设置为 `true` 则代表可以允许插件降级并进行继续请求的操作。 |
   ```



##########
docs/zh/latest/plugins/limit-count.md:
##########
@@ -243,13 +246,13 @@ curl -i http://127.0.0.1:9180/apisix/admin/routes/1 -H 
'X-API-KEY: edd1c9f034335
 
 ## 测试插件
 
-上述配置限制了 60 秒内只能访问 2 次,前两次访问都会正常访问:
+上述配置限制了请求 60 秒内只能访问 2 次,通过 `curl` 命令测试请求访问:

Review Comment:
   ```suggestion
   上述配置限制了 60 秒内,请求只能访问 2 次。可通过 `curl` 命令测试请求访问:
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to