
# 分组统计信息查询-最近一小时
#### 功能介绍
根据API分组的id和最近的一段时间查询API被调用的次数，统计周期为1分钟。查询范围一小时以内，一分钟一个样本，其样本值为一分钟内的累计值。
![](https://support.huaweicloud.com/api-apig/public_sys-resources/note_3.0-zh-cn.png)
为了安全起见，在服务器上使用curl命令调用接口查询信息后，需要清理历史操作记录，包括但不限于"\~/.bash_history"、"/var/log/messages"（如有）。
#### URI
HTTP/HTTPS请求方法以及URI如下表所示。
表1HTTP/HTTPS请求方法以及URI 
| 请求方法 | URI                                                       |
|:---|:---|
| GET  | /v1.0/apigw/statistics/group/latest?group_id=\[group_id\] |
   
#### 请求消息
表2参数说明 
| 参数       | 是否必选 | 类型     | 说明    |
|:---|:---|:---|:---|
| group_id | 是    | String | 分组的id |
   
#### 响应消息
表3参数说明 
| 参数         | 类型      | 说明           | 操作类型 |
|:---|:---|:---|:---|
| code       | String  | 响应码          | R    |
| msg        | String  | 返回消息         | R    |
| start_time | Long    | 开始时间的UTC时间戳  | R    |
| end_time   | Long    | 截止时间的UTC时间戳  | R    |
| list       | 结构体数据类型 | 统计指标的数据结构结构体 | R    |
   
表4参数说明 
| 参数                | 类型      | 说明                            | 操作类型 |
|:---|:---|:---|:---|
| group_id          | String  | 分组的id                         | R    |
| current_minute    | Long    | utc的timestamp                 | R    |
| provider          | String  | API拥有者                        | R    |
| req_count         | Integer | 请求总次数                         | R    |
| max_latency       | Integer | 最大延时(ms)                      | R    |
| avg_latency       | Double  | 平均耗时（ms）                      | R    |
| output_throughput | Integer | 下行吞吐量（byte）                   | R    |
| input_throughput  | Integer | 上行吞吐量（byte）                   | R    |
| req_count4xx      | Integer | 4xx响应码总次数                     | R    |
| req_count5xx      | Integer | 5xx响应码总次数                     | R    |
| req_count2xx      | Integer | 2xx响应码总次数                     | R    |
| req_count_error   | Integer | 错误次数                          | R    |
| register_time     | String  | 记录时间（格式为：yyyy-MM-dd HH:mm:ss） | R    |
| req_time          | String  | 请求时间（格式为：yyyy-MM-dd HH:mm:ss） | R    |
   
响应消息样例：
```
{
"code": "000000",
"msg": "",
"list": [{
"group_id": "d7b52683-341b-4234-8261-66b4cfbfbda5",
"current_minute": 1516849440,
"provider": "205fa874817a4dcfae9222a3be4725e8",
"req_count": 1981,
"max_latency": 199,
"avg_latency": 98.17,
"output_throughput": 694483,
"input_throughput": 694483,
"req_count4xx": 669,
"req_count5xx": 312,
"req_count2xx": 327,
"req_count_error": 981,
"register_time": "2018-01-25 11:04:09",
"req_time": "2018-01-25 11:04:00"
}],
"start_time": 1516845900,
"end_time": 1516849440
}
```
#### 状态码
表5返回消息说明 
| 状态码 | 说明            |
|:---|:---|
| 200 | Query Success |
   
